mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[d3d11] Refactor D3D11UserDefinedAnnotation
This commit is contained in:
parent
3ead348b82
commit
4af974768a
@ -30,21 +30,18 @@ namespace dxvk {
|
|||||||
registrationFunction(annotation);
|
registrationFunction(annotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
D3D11UserDefinedAnnotation::D3D11UserDefinedAnnotation(D3D11DeviceContext* ctx)
|
D3D11UserDefinedAnnotation::D3D11UserDefinedAnnotation(
|
||||||
: m_container(ctx),
|
D3D11DeviceContext* container,
|
||||||
m_eventDepth(0) {
|
const Rc<DxvkDevice>& dxvkDevice)
|
||||||
if (m_container->IsAnnotationEnabled())
|
: m_container(container), m_eventDepth(0),
|
||||||
|
m_annotationsEnabled(dxvkDevice->instance()->extensions().extDebugUtils) {
|
||||||
|
if (m_annotationsEnabled)
|
||||||
RegisterUserDefinedAnnotation<true>(this);
|
RegisterUserDefinedAnnotation<true>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
D3D11UserDefinedAnnotation::D3D11UserDefinedAnnotation(const D3D11UserDefinedAnnotation&)
|
|
||||||
{
|
|
||||||
if (m_container->IsAnnotationEnabled())
|
|
||||||
RegisterUserDefinedAnnotation<true>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
D3D11UserDefinedAnnotation::~D3D11UserDefinedAnnotation() {
|
D3D11UserDefinedAnnotation::~D3D11UserDefinedAnnotation() {
|
||||||
if (m_container->IsAnnotationEnabled())
|
if (m_annotationsEnabled)
|
||||||
RegisterUserDefinedAnnotation<false>(this);
|
RegisterUserDefinedAnnotation<false>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +66,7 @@ namespace dxvk {
|
|||||||
INT STDMETHODCALLTYPE D3D11UserDefinedAnnotation::BeginEvent(
|
INT STDMETHODCALLTYPE D3D11UserDefinedAnnotation::BeginEvent(
|
||||||
D3DCOLOR Color,
|
D3DCOLOR Color,
|
||||||
LPCWSTR Name) {
|
LPCWSTR Name) {
|
||||||
if (!m_container->IsAnnotationEnabled())
|
if (!m_annotationsEnabled)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
D3D10DeviceLock lock = m_container->LockContext();
|
D3D10DeviceLock lock = m_container->LockContext();
|
||||||
@ -89,7 +86,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
INT STDMETHODCALLTYPE D3D11UserDefinedAnnotation::EndEvent() {
|
INT STDMETHODCALLTYPE D3D11UserDefinedAnnotation::EndEvent() {
|
||||||
if (!m_container->IsAnnotationEnabled())
|
if (!m_annotationsEnabled)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
D3D10DeviceLock lock = m_container->LockContext();
|
D3D10DeviceLock lock = m_container->LockContext();
|
||||||
@ -105,7 +102,7 @@ namespace dxvk {
|
|||||||
void STDMETHODCALLTYPE D3D11UserDefinedAnnotation::SetMarker(
|
void STDMETHODCALLTYPE D3D11UserDefinedAnnotation::SetMarker(
|
||||||
D3DCOLOR Color,
|
D3DCOLOR Color,
|
||||||
LPCWSTR Name) {
|
LPCWSTR Name) {
|
||||||
if (!m_container->IsAnnotationEnabled())
|
if (!m_annotationsEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D3D10DeviceLock lock = m_container->LockContext();
|
D3D10DeviceLock lock = m_container->LockContext();
|
||||||
@ -123,7 +120,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
BOOL STDMETHODCALLTYPE D3D11UserDefinedAnnotation::GetStatus() {
|
BOOL STDMETHODCALLTYPE D3D11UserDefinedAnnotation::GetStatus() {
|
||||||
return m_container->IsAnnotationEnabled();
|
return m_annotationsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "d3d11_include.h"
|
#include "d3d11_include.h"
|
||||||
|
|
||||||
#include "../dxvk/dxvk_annotation.h"
|
#include "../dxvk/dxvk_annotation.h"
|
||||||
|
#include "../dxvk/dxvk_device.h"
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
@ -11,10 +13,15 @@ namespace dxvk {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
D3D11UserDefinedAnnotation(D3D11DeviceContext* ctx);
|
D3D11UserDefinedAnnotation(
|
||||||
D3D11UserDefinedAnnotation(const D3D11UserDefinedAnnotation&);
|
D3D11DeviceContext* container,
|
||||||
|
const Rc<DxvkDevice>& dxvkDevice);
|
||||||
|
|
||||||
~D3D11UserDefinedAnnotation();
|
~D3D11UserDefinedAnnotation();
|
||||||
|
|
||||||
|
D3D11UserDefinedAnnotation (const D3D11UserDefinedAnnotation&) = delete;
|
||||||
|
D3D11UserDefinedAnnotation& operator = (const D3D11UserDefinedAnnotation&) = delete;
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE AddRef();
|
ULONG STDMETHODCALLTYPE AddRef();
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE Release();
|
ULONG STDMETHODCALLTYPE Release();
|
||||||
@ -37,10 +44,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
D3D11DeviceContext* m_container;
|
D3D11DeviceContext* m_container;
|
||||||
|
int32_t m_eventDepth;
|
||||||
// Stack depth for non-finalized BeginEvent calls
|
bool m_annotationsEnabled;
|
||||||
int32_t m_eventDepth;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ namespace dxvk {
|
|||||||
m_multithread(this, false),
|
m_multithread(this, false),
|
||||||
m_device (Device),
|
m_device (Device),
|
||||||
m_staging (Device, StagingBufferSize),
|
m_staging (Device, StagingBufferSize),
|
||||||
m_annotation(this),
|
m_annotation(this, Device),
|
||||||
m_csFlags (CsFlags),
|
m_csFlags (CsFlags),
|
||||||
m_csChunk (AllocCsChunk()),
|
m_csChunk (AllocCsChunk()),
|
||||||
m_cmdData (nullptr) {
|
m_cmdData (nullptr) {
|
||||||
@ -2821,7 +2821,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
BOOL STDMETHODCALLTYPE D3D11DeviceContext::IsAnnotationEnabled() {
|
BOOL STDMETHODCALLTYPE D3D11DeviceContext::IsAnnotationEnabled() {
|
||||||
return m_device->instance()->extensions().extDebugUtils;
|
return m_annotation.GetStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user