mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-05 01:24:14 +01:00
[d3d11] Use IDXVKUserDefinedAnnotation
This commit is contained in:
parent
a010397f34
commit
5d54d79865
@ -2,6 +2,8 @@
|
|||||||
#include "d3d11_context.h"
|
#include "d3d11_context.h"
|
||||||
#include "d3d11_device.h"
|
#include "d3d11_device.h"
|
||||||
|
|
||||||
|
#include "../util/util_misc.h"
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
D3D11UserDefinedAnnotation::D3D11UserDefinedAnnotation(D3D11DeviceContext* ctx)
|
D3D11UserDefinedAnnotation::D3D11UserDefinedAnnotation(D3D11DeviceContext* ctx)
|
||||||
@ -32,21 +34,17 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
INT STDMETHODCALLTYPE D3D11UserDefinedAnnotation::BeginEvent(
|
INT STDMETHODCALLTYPE D3D11UserDefinedAnnotation::BeginEvent(
|
||||||
|
D3DCOLOR Color,
|
||||||
LPCWSTR Name) {
|
LPCWSTR Name) {
|
||||||
if (!m_container->IsAnnotationEnabled())
|
if (!m_container->IsAnnotationEnabled())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
D3D10DeviceLock lock = m_container->LockContext();
|
m_container->EmitCs([color = Color, labelName = dxvk::str::fromws(Name)](DxvkContext *ctx) {
|
||||||
|
|
||||||
m_container->EmitCs([labelName = dxvk::str::fromws(Name)](DxvkContext *ctx) {
|
|
||||||
VkDebugUtilsLabelEXT label;
|
VkDebugUtilsLabelEXT label;
|
||||||
label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||||
label.pNext = nullptr;
|
label.pNext = nullptr;
|
||||||
label.pLabelName = labelName.c_str();
|
label.pLabelName = labelName.c_str();
|
||||||
label.color[0] = 1.0f;
|
DecodeD3DCOLOR(color, label.color);
|
||||||
label.color[1] = 1.0f;
|
|
||||||
label.color[2] = 1.0f;
|
|
||||||
label.color[3] = 1.0f;
|
|
||||||
|
|
||||||
ctx->beginDebugLabel(&label);
|
ctx->beginDebugLabel(&label);
|
||||||
});
|
});
|
||||||
@ -70,21 +68,17 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11UserDefinedAnnotation::SetMarker(
|
void STDMETHODCALLTYPE D3D11UserDefinedAnnotation::SetMarker(
|
||||||
|
D3DCOLOR Color,
|
||||||
LPCWSTR Name) {
|
LPCWSTR Name) {
|
||||||
if (!m_container->IsAnnotationEnabled())
|
if (!m_container->IsAnnotationEnabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D3D10DeviceLock lock = m_container->LockContext();
|
m_container->EmitCs([color = Color, labelName = dxvk::str::fromws(Name)](DxvkContext *ctx) {
|
||||||
|
|
||||||
m_container->EmitCs([labelName = dxvk::str::fromws(Name)](DxvkContext *ctx) {
|
|
||||||
VkDebugUtilsLabelEXT label;
|
VkDebugUtilsLabelEXT label;
|
||||||
label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||||
label.pNext = nullptr;
|
label.pNext = nullptr;
|
||||||
label.pLabelName = labelName.c_str();
|
label.pLabelName = labelName.c_str();
|
||||||
label.color[0] = 1.0f;
|
DecodeD3DCOLOR(color, label.color);
|
||||||
label.color[1] = 1.0f;
|
|
||||||
label.color[2] = 1.0f;
|
|
||||||
label.color[3] = 1.0f;
|
|
||||||
|
|
||||||
ctx->insertDebugLabel(&label);
|
ctx->insertDebugLabel(&label);
|
||||||
});
|
});
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "d3d11_include.h"
|
#include "d3d11_include.h"
|
||||||
|
#include "../dxvk/dxvk_annotation.h"
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
class D3D11DeviceContext;
|
class D3D11DeviceContext;
|
||||||
|
|
||||||
class D3D11UserDefinedAnnotation final : public ID3DUserDefinedAnnotation {
|
class D3D11UserDefinedAnnotation final : public IDXVKUserDefinedAnnotation {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -22,11 +23,13 @@ namespace dxvk {
|
|||||||
void** ppvObject);
|
void** ppvObject);
|
||||||
|
|
||||||
INT STDMETHODCALLTYPE BeginEvent(
|
INT STDMETHODCALLTYPE BeginEvent(
|
||||||
|
D3DCOLOR Color,
|
||||||
LPCWSTR Name);
|
LPCWSTR Name);
|
||||||
|
|
||||||
INT STDMETHODCALLTYPE EndEvent();
|
INT STDMETHODCALLTYPE EndEvent();
|
||||||
|
|
||||||
void STDMETHODCALLTYPE SetMarker(
|
void STDMETHODCALLTYPE SetMarker(
|
||||||
|
D3DCOLOR Color,
|
||||||
LPCWSTR Name);
|
LPCWSTR Name);
|
||||||
|
|
||||||
BOOL STDMETHODCALLTYPE GetStatus();
|
BOOL STDMETHODCALLTYPE GetStatus();
|
||||||
|
@ -55,7 +55,8 @@ namespace dxvk {
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (riid == __uuidof(ID3DUserDefinedAnnotation)) {
|
if (riid == __uuidof(ID3DUserDefinedAnnotation)
|
||||||
|
|| riid == __uuidof(IDXVKUserDefinedAnnotation)) {
|
||||||
*ppvObject = ref(&m_annotation);
|
*ppvObject = ref(&m_annotation);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user