Skip to content

[mlir][dxsa] Add ld, ld2dms, ld_raw, ld_structured, ld_uav_typed#213

Open
asavonic wants to merge 14 commits into
dxsa-mlirfrom
dxsa-mlir-ld
Open

[mlir][dxsa] Add ld, ld2dms, ld_raw, ld_structured, ld_uav_typed#213
asavonic wants to merge 14 commits into
dxsa-mlirfrom
dxsa-mlir-ld

Conversation

@asavonic

@asavonic asavonic commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This PR is a stack of #182 and #203, plus the new instructions:

  • ld
  • ld2dms
  • ld_raw
  • ld_structured
  • ld_uav_typed

Please ignore all commits except for the last one.

asavonic and others added 13 commits June 19, 2026 00:43
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.
@asavonic asavonic requested a review from tagolog July 1, 2026 03:10
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/include/mlir/Dialect/DXSA/IR/DXSAResourceOps.td Outdated
Comment thread mlir/lib/Target/DXSA/BinaryParser.cpp Outdated
Comment thread mlir/lib/Target/DXSA/BinaryParser.cpp
Comment thread mlir/lib/Target/DXSA/BinaryParser.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants