GS/DX12: Fix validation errors when depth testing and sampling #13756
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Fixes validation warnings when performing depth testing and sampling
Rationale behind Changes
When depth testing and sampling, we switch the depth stencil to a read-only state, however,
OMSetRenderTargets()would immediately switch it back to write-only.Additionally, using a read-only depth-stencil with render passes has additional requirements (listed here), such as providing a read-only dsv.
This seems to fix run to run variances of the
Time Crisis II _NTSC-U__SLUS-20219-targetsizecoorddump.It looks like we don't use stencil here, but I'll note it seems that DX12 allows us to specify the read/write only nature of depth and stencil separately (I think depth and stencil are separate sub-resource planes?).
Suggested Testing Steps
Test DX12
Did you use AI to help find, test, or implement this issue or feature?
No