Repository navigation
hk: keep shader object binaries independent of depthClipControl - #279
Merged
Merged
Conversation
A shader object binary depended on whether its device enabled depthClipControl. Every serialized shader recorded the enabled feature in its flags byte, and the last pre-rasterization stage applied agx_nir_lower_clip_m1_1 only on such a device. On G17P this failed every dEQP-VK.shader_object.binary.device_features.* case (352) and every binary.query.*.device_no_exts_features case (11). Those tests compare the binaries of one shader created on devices with different enabled features. A shader object, which compiles without features, now always applies the lowering where the device supports depthClipControl. Internal shaders, which also compile without features, do the same. The clip z coefficient is 0 unless negativeOneToOne is set, and with 0 the lowering now keeps z exactly. Before, its lerp turned -0 into +0 and gave NaN for an infinite w. The flags byte now records whether the shader applied the lowering, including for shaders from the device's binary cache. Any device with the feature accepts a binary that has it; only a device that did not enable the feature accepts one without it. Pipelines and mesh shaders still decide by the enabled feature. Signed-off-by: Diljit Singh <hey@djdev.me>
This was referenced Nov 13, 2026
Merged
Author
|
Gate evidence for merging #279 (batch1, step 5 of a tree-checked sequence):
|
This was referenced Nov 13, 2026
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.
Problem
On G17P, a shader object binary depended on whether its device enabled
depthClipControl:agx_nir_lower_clip_m1_1only on such a device.dEQP-VK.shader_object.binary.device_features.*andbinary.query.*.device_no_exts_featurescompare the binaries of one shader created on devices with different enabled features. All 352 + 11 of those cases failed on G17P. M5 doesn't advertise the feature and passes them.Change
depthClipControl. Internal shaders, which also compile without features, do the same. The clip z coefficient is 0 unless negativeOneToOne is set.agx_nir_lower_clip_m1_1now keeps z bit for bit by selecting on the coefficient. Before, its lerp turned -0 into +0 and gave NaN for an infinite w on every G17P device that enabled the feature, CTS default devices included. A host check over special z × w pairs: with 0, z is returned exactly in all 196 (the old lerp differed in 46); with 1/2 the result is unchanged.Testing
git range-diffidentical) against the base build 8f013bf:dEQP-VK.spirv_assembly.instruction.compute.opfma.fp32.*.denorm_preserve.*cases, one process each: base 20 Fail / 4 Pass, f3 24 Pass;dEQP-VK.shader_object.binary.*: 437 / 437 Pass, the 363 base failures fixed, 0 regressions;spirv_assemblyfloat_controls case plus the opfma group, 13,836 cases: 8,463 Pass, 5,373 NotSupported, 0 Fail; 20 fixed, 0 regressions;test-clip-m1-1.cppis updated for the select. The asahi gtests are to run on the merged tree.🤖 Generated with Claude Code