Skip to content

Commit

Permalink
[d3d9] Fix race condition in PIX events
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpyneDreams committed Nov 28, 2024
1 parent b8ce414 commit 8251535
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/d3d9/d3d9_annotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ namespace dxvk {
INT STDMETHODCALLTYPE D3D9UserDefinedAnnotation::BeginEvent(
D3DCOLOR Color,
LPCWSTR Name) {
D3D9DeviceLock lock = m_container->LockDevice();
m_container->EmitCs([color = Color, labelName = dxvk::str::fromws(Name)](DxvkContext *ctx) {
VkDebugUtilsLabelEXT label;
label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
Expand All @@ -143,6 +144,7 @@ namespace dxvk {


INT STDMETHODCALLTYPE D3D9UserDefinedAnnotation::EndEvent() {
D3D9DeviceLock lock = m_container->LockDevice();
m_container->EmitCs([](DxvkContext *ctx) {
ctx->endDebugLabel();
});
Expand All @@ -155,6 +157,7 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D9UserDefinedAnnotation::SetMarker(
D3DCOLOR Color,
LPCWSTR Name) {
D3D9DeviceLock lock = m_container->LockDevice();
m_container->EmitCs([color = Color, labelName = dxvk::str::fromws(Name)](DxvkContext *ctx) {
VkDebugUtilsLabelEXT label;
label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
Expand Down

0 comments on commit 8251535

Please sign in to comment.