Skip to content

Commit

Permalink
Make VRS mask update safer on D3D12.
Browse files Browse the repository at this point in the history
(cherry picked from commit 361ed58)
  • Loading branch information
mbucchia committed Sep 21, 2022
1 parent a2fc561 commit 08b28b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions XR_APILAYER_NOVENDOR_toolkit/vrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,15 @@ namespace {
auto mask = isDoubleWide ? maskForSize.maskDoubleWide : maskForSize.mask[(size_t)eye];
mask->setState(D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE);

// For now, we update the mask upon the next call to xrEndFrame(). This introduces a frame latency,
// but is much safer to do.
#if 0
// The commands above must execute in a different command list than the app command list to avoid
// trashing it, but it must execute prior to applying the VRS mask. Here we assume that the game
// uses only the command queue that it passed to the runtime. There is no need for a fence here
// because we know the app command list will be executed later, therefore ensuring correct ordering.
m_device->flushContext();
#endif

// RSSetShadingRate() function sets both the combiners and the per-drawcall shading rate.
// We set to 1X1 for all sources and all combiners to MAX, so that the coarsest wins (per-drawcall,
Expand Down

0 comments on commit 08b28b7

Please sign in to comment.