[mlir][dxsa] Add ld, ld2dms, ld_raw, ld_structured, ld_uav_typed#213
Open
asavonic wants to merge 14 commits into
Open
[mlir][dxsa] Add ld, ld2dms, ld_raw, ld_structured, ld_uav_typed#213asavonic wants to merge 14 commits into
asavonic wants to merge 14 commits into
Conversation
Sample instruction takes an address, a resource (texture), a sampler, and writes texture data to the destination register. There are several optional that can be present: - Offset is encoded as an extended opcode. - LOD clamp and feeback for sample_cl_s. The spec mentions clamp and feedback as optional, but DXC decodes them both. It is possible that they are always present as operands, but can be null. Other extended instruction are added for other resource instructions, and not enabled for sample instruction.
Added: - sample_b - sample_c - sample_c_lz - sample_d - sample_l These have different semantic and operands, so they are modeled as separate instructions. Each also has a clamp_feedback variant with optional clamp and feeback operands.
Co-authored-by: Vladimir Shiryaev <tagolog@users.noreply.github.com>
Feedback (ClampFeedback) and Offset are both optional attributes. MLIR parser was not able to handle cases where feedback is present, but offset is absent and failed roundtrip verifier tests. Now such instructions are separate, and feedback operand is no longer optional.
tagolog
approved these changes
Jul 1, 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.
This PR is a stack of #182 and #203, plus the new instructions:
ldld2dmsld_rawld_structuredld_uav_typedPlease ignore all commits except for the last one.