mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 13:08:50 +01:00
[dxvk] Introduce DxvkMarker
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
parent
8feabc653e
commit
9d981ec1a8
@ -8,6 +8,7 @@
|
||||
#include "dxvk_objects.h"
|
||||
#include "dxvk_resource.h"
|
||||
#include "dxvk_util.h"
|
||||
#include "dxvk_marker.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
@ -1252,6 +1253,15 @@ namespace dxvk {
|
||||
*/
|
||||
void insertDebugLabel(VkDebugUtilsLabelEXT *label);
|
||||
|
||||
/**
|
||||
* \brief Inserts a marker object
|
||||
* \param [in] marker The marker
|
||||
*/
|
||||
template<typename T>
|
||||
void insertMarker(const Rc<DxvkMarker<T>>& marker) {
|
||||
m_cmd->trackResource<DxvkAccess::Write>(marker);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Increments a given stat counter
|
||||
*
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "dxvk_shader.h"
|
||||
#include "dxvk_stats.h"
|
||||
#include "dxvk_unbound.h"
|
||||
#include "dxvk_marker.h"
|
||||
|
||||
#include "../vulkan/vulkan_presenter.h"
|
||||
|
||||
@ -348,7 +349,7 @@ namespace dxvk {
|
||||
*/
|
||||
Rc<DxvkSampler> createSampler(
|
||||
const DxvkSamplerCreateInfo& createInfo);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retrieves stat counters
|
||||
*
|
||||
|
35
src/dxvk/dxvk_marker.h
Normal file
35
src/dxvk/dxvk_marker.h
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "dxvk_resource.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
/**
|
||||
* \brief Marker
|
||||
*
|
||||
* Arbitrary marker that can be used to track whether
|
||||
* the GPU has finished processing certain commands,
|
||||
* and stores some data.
|
||||
*/
|
||||
template<typename T>
|
||||
class DxvkMarker : public DxvkResource {
|
||||
|
||||
public:
|
||||
|
||||
DxvkMarker(T&& payload)
|
||||
: m_payload(std::move(payload)) { }
|
||||
|
||||
DxvkMarker(const T& payload)
|
||||
: m_payload(payload) { }
|
||||
|
||||
const T& payload() const {
|
||||
return m_payload;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
T m_payload;
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user