Repository navigation
feat(agc): accept conservative Z export in DB_SHADER_CONTROL - #752
Merged
oneandonlydean merged 1 commit intoOct 5, 2026
Merged
Conversation
Celegans12
force-pushed
the
feat/agc-conservative-z-export
branch
from
October 5, 2026 20:41
06dacd7 to
0cc7f28
Compare
This was referenced Oct 5, 2026
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
DecodeState, the draw precheck and DecodePixelStageInfo rejected every nonzero CONSERVATIVE_Z_EXPORT (DB_SHADER_CONTROL bits 13-14). EXPORT_LESS_THAN_Z (1) and EXPORT_GREATER_THAN_Z (2) promise that the exported Z stays on one side of the interpolated Z. The value now reaches the recompiler as a pixel stage field, and a pixel shader that writes FragDepth declares DepthLess or DepthGreater next to DepthReplacing, the SPIR-V modes RADV maps to these values. Vulkan lets those modes only add a depth test of the interpolated Z before shading, so a shader that keeps the promise renders the same. The reserved value 3 still throws. The field is part of the recompile cache key, the draw key and the serialized request (version 7), and ValidateShaders accepts both modes.
Celegans12
force-pushed
the
feat/agc-conservative-z-export
branch
from
October 5, 2026 22:35
0cc7f28 to
4a67b14
Compare
MichonGoddijn231849
added a commit
to MichonGoddijn231849/AnyPS5-fork
that referenced
this pull request
Oct 6, 2026
boykopovar#752 took version 7 for the pixel stage's conservative Z export, so a version 7 request written without this change has no PA_CL_VS_OUT_CNTL word: the field moves to version 8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MichonGoddijn231849
added a commit
to MichonGoddijn231849/AnyPS5-fork
that referenced
this pull request
Oct 7, 2026
boykopovar#752 took version 7 for the pixel stage's conservative Z export, so a version 7 request written without this change has no PA_CL_VS_OUT_CNTL word: the field moves to version 8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
alfalfa-star
pushed a commit
to alfalfa-star/AnyOrbitr
that referenced
this pull request
Oct 7, 2026
boykopovar#752 took version 7 for the pixel stage's conservative Z export, so a version 7 request written without this change has no PA_CL_VS_OUT_CNTL word: the field moves to version 8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MichonGoddijn231849
added a commit
to MichonGoddijn231849/AnyPS5-fork
that referenced
this pull request
Oct 7, 2026
boykopovar#752 took version 7 for the pixel stage's conservative Z export, so a version 7 request written without this change has no PA_CL_VS_OUT_CNTL word: the field moves to version 8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MichonGoddijn231849
added a commit
to MichonGoddijn231849/AnyPS5-fork
that referenced
this pull request
Oct 8, 2026
boykopovar#752 took version 7 for the pixel stage's conservative Z export, so a version 7 request written without this change has no PA_CL_VS_OUT_CNTL word: the field moves to version 8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
A nonzero DB_SHADER_CONTROL.CONSERVATIVE_Z_EXPORT (bits 13-14) was rejected by
DecodeStateand the draw precheck (depth export, shader coverage or ordered fragment execution) and byDecodePixelStageInfo(AGC graphics: DB_SHADER_CONTROL.CONSERVATIVE_Z_EXPORT is unsupported).DecodeState/precheck mask and become the pixel stage fieldConservativeZExport: 0EXPORT_ANY_Z, 1EXPORT_LESS_THAN_Z, 2EXPORT_GREATER_THAN_Z, as in Mesa's GFX10.3 register database (enum, field). The reserved value 3 still throws.FragDepthdeclaresDepthLess(1) orDepthGreater(2) next toDepthReplacing, the inverse of RADV's mapping (radv_shader.c, spirv_to_nir.c). Without a Z export the depth is the interpolated Z, which keeps either promise, so nothing is declared.ValidateShadersaccepts both modes. Drawing a depth-exporting pixel shader still needs fix(agc): fragment SampleId, Layer, FragDepth and SampleMask interfaces #375 (Z_EXPORT_ENABLE,SPI_SHADER_Z_FORMAT,FragDepth,DepthReplacing).37a91497897c68dd(all_shaders.xpps, 2 instances) hasDB_SHADER_CONTROL = 0x2021and ends withv_sub_f32 v0, v2, v0(0x08000102, v2 = POS_Z) andexp mrtz v0 done vm(0xf8001881 0x00000000).ValidateShadersline. feat(agc): single-sample sample masks as a per-quad-pixel discard #448 also adds a pixel field at the same places inCacheKey.hpp,ShaderStageInputInfo.hppandShaderInputInfoBuilder.cppand bumps the same serializer version lines. TheirState.cppandShaderInputState.cppedits merge cleanly.Tested
main681f83e: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)conservativeZExportTestsinagc_driver_graphics: with a shader that exports POS_Z as MRTZ, DB_SHADER_CONTROL 0x21, 0x2021, 0x4021 and 0x2020 giveDepthReplacing, plusDepthLess, plusDepthGreater, and no depth mode, also after a serializer round trip, with distinct cache keys;DecodeStateand the precheck accept 0x2020 and 0x4020; 0x6021 throws;ValidateShadersacceptsDepthLessandDepthGreaterand still rejectsDepthUnchanged. Onmainit fails with theDecodePixelStageInfomessage above.DecodePixelStageInfo: only37a91497897c68ddchanges. It now decodes, and its SPIR-V gainsOpExecutionMode DepthLessand passesspirv-val. The other 10,503 give the same result and SPIR-V size. Not yet run in game.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)