Repository navigation
xshader: fix VOP3 operand handling in lower_first_lane_reads and mesh validate_launch - #288
Merged
Merged
Conversation
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.
Summary
Two targeted fixes in
tools/shader-compilerfor cases where generic VOP3 decoding exposed unused or differently-typed register operands:lower_first_lane_reads(lanes.rs,pipeline.rs):Sgpr(0)padding slots emitted by the generic VOP3 decoder for 1-operand VOP1 (0x180..0x200) and 2-operand VOPC/VOP2 (< 0x180, excluding 3-operandv_cndmask_b32/ carry-in ops) when checking whetherlaneis read betweens_ff1_i32_b*andv_readlane_b32.lower_first_lane_readsfor all pixel shaders (not only root-less pixel shaders with a resource-heap base), since every pixel shader executes as a single-lane wave (exec_lo = 1u).validate_launch(mesh.rs):v_readlane_b32destinations asSgpr(n)rather thanVgpr(n)inwrites(), matching RDNA2 semantics wherev_readlane_b32writes a scalar register despite the generic VOP3 decoder storing it inOpnd::Vgpr. This prevents false rejections when a mesh shader reads a lane into an SGPR whose index matcheslane_index.Verification
lower_first_lane_reads_ignores_unused_vop3_s0_paddingintools/shader-compiler/src/tests/hlsl.rsvalidate_launch_ignores_readlane_sgpr_destination_matching_lane_vgprintools/shader-compiler/src/tests/hlsl/mesh.rscargo testfortuxbox-dxbc(21/21 passed) andtuxbox-xshader(400/400 passed).