Skip to content

Commit

Permalink
Fix bug in the tracing code.
Browse files Browse the repository at this point in the history
(cherry picked from commit 54b628d)
  • Loading branch information
mbucchia committed Nov 3, 2022
1 parent 0c24c3b commit cf5a2c6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
20 changes: 12 additions & 8 deletions XR_APILAYER_NOVENDOR_toolkit/d3d11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2114,9 +2114,11 @@ void main(uint3 id : SV_DispatchThreadID)
TLPArg(Context, "Context"),
TLArg(NumViews, "NumViews"),
TLPArg(pDepthStencilView, "DSV"));
for (UINT i = 0; i < NumViews; i++) {
TraceLoggingWriteTagged(
local, "ID3D11DeviceContext_OMSetRenderTargets", TLPArg(ppRenderTargetViews[i], "RTV"));
if (IsTraceEnabled()) {
for (UINT i = 0; i < NumViews; i++) {
TraceLoggingWriteTagged(
local, "ID3D11DeviceContext_OMSetRenderTargets", TLPArg(ppRenderTargetViews[i], "RTV"));
}
}

assert(g_instance);
Expand Down Expand Up @@ -2146,10 +2148,12 @@ void main(uint3 id : SV_DispatchThreadID)
TLPArg(Context, "Context"),
TLArg(NumRTVs, "NumRTVs"),
TLPArg(pDepthStencilView, "DSV"));
for (UINT i = 0; i < NumRTVs; i++) {
TraceLoggingWriteTagged(local,
"ID3D11DeviceContext_OMSetRenderTargetsAndUnorderedAccessViews",
TLPArg(ppRenderTargetViews[i], "RTV"));
if (IsTraceEnabled() && NumRTVs != D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL) {
for (UINT i = 0; i < NumRTVs; i++) {
TraceLoggingWriteTagged(local,
"ID3D11DeviceContext_OMSetRenderTargetsAndUnorderedAccessViews",
TLPArg(ppRenderTargetViews[i], "RTV"));
}
}

assert(g_instance);
Expand Down Expand Up @@ -2180,7 +2184,7 @@ void main(uint3 id : SV_DispatchThreadID)
TLPArg(Context, "Context"),
TLArg(NumViewports, "NumViewports"));

if (pViewports) {
if (IsTraceEnabled() && pViewports) {
for (UINT i = 0; i < NumViewports; i++) {
TraceLoggingWriteTagged(local,
"ID3D11DeviceContext_RSSetViewports",
Expand Down
10 changes: 6 additions & 4 deletions XR_APILAYER_NOVENDOR_toolkit/d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2453,10 +2453,12 @@ namespace {
TLArg(NumRenderTargetDescriptors, "NumRenderTargetDescriptors"),
TLArg(RTsSingleHandleToDescriptorRange, "RTsSingleHandleToDescriptorRange"),
TLPArg(pDepthStencilDescriptor ? pDepthStencilDescriptor->ptr : 0, "DSV"));
for (UINT i = 0; i < NumRenderTargetDescriptors; i++) {
TraceLoggingWriteTagged(local,
"ID3D12GraphicsCommandList_OMSetRenderTargets",
TLPArg(pRenderTargetDescriptors[i].ptr, "RTV"));
if (IsTraceEnabled()) {
for (UINT i = 0; i < NumRenderTargetDescriptors; i++) {
TraceLoggingWriteTagged(local,
"ID3D12GraphicsCommandList_OMSetRenderTargets",
TLPArg(pRenderTargetDescriptors[i].ptr, "RTV"));
}
}

assert(g_instance);
Expand Down

0 comments on commit cf5a2c6

Please sign in to comment.