1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 22:08:59 +01:00

[dxvk] Introduce DxvkMarker

Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
Robin Kertels 2022-08-03 19:16:30 +02:00 committed by Philip Rebohle
parent 8feabc653e
commit 9d981ec1a8
3 changed files with 47 additions and 1 deletions

View File

@ -8,6 +8,7 @@
#include "dxvk_objects.h" #include "dxvk_objects.h"
#include "dxvk_resource.h" #include "dxvk_resource.h"
#include "dxvk_util.h" #include "dxvk_util.h"
#include "dxvk_marker.h"
namespace dxvk { namespace dxvk {
@ -1252,6 +1253,15 @@ namespace dxvk {
*/ */
void insertDebugLabel(VkDebugUtilsLabelEXT *label); 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 * \brief Increments a given stat counter
* *

View File

@ -22,6 +22,7 @@
#include "dxvk_shader.h" #include "dxvk_shader.h"
#include "dxvk_stats.h" #include "dxvk_stats.h"
#include "dxvk_unbound.h" #include "dxvk_unbound.h"
#include "dxvk_marker.h"
#include "../vulkan/vulkan_presenter.h" #include "../vulkan/vulkan_presenter.h"
@ -348,7 +349,7 @@ namespace dxvk {
*/ */
Rc<DxvkSampler> createSampler( Rc<DxvkSampler> createSampler(
const DxvkSamplerCreateInfo& createInfo); const DxvkSamplerCreateInfo& createInfo);
/** /**
* \brief Retrieves stat counters * \brief Retrieves stat counters
* *

35
src/dxvk/dxvk_marker.h Normal file
View 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;
};
}