Skip to content

[dxsa][mlir] Add bufinfo, resinfo, samplepos, sampleinfo#214

Merged
asavonic merged 3 commits into
dxsa-mlirfrom
kuilpd/dxsa-mlir-bufinfo-resinfo-samplepos-sampleinfo
Jul 2, 2026
Merged

[dxsa][mlir] Add bufinfo, resinfo, samplepos, sampleinfo#214
asavonic merged 3 commits into
dxsa-mlirfrom
kuilpd/dxsa-mlir-bufinfo-resinfo-samplepos-sampleinfo

Conversation

@kuilpd

@kuilpd kuilpd commented Jul 1, 2026

Copy link
Copy Markdown

Add resource instructions bufinfo, resinfo, samplepos, sampleinfo.

This patch also changes verifyInstructionLength so that it fails only if parsed operands length is greater than the specified instruction length in the opcode, and it skips the unparsed tokens if the specified instruction length is longer than parsed operands. This matches the behavior of dxbc2dxil, which doesn't check if there are unparsed tokens left, and simply moves further to parse tokens past the specified instruction length. FXC can output samplepos with an extra token in the end, not sure about other instructions.

@kuilpd kuilpd requested review from asavonic and tagolog July 1, 2026 16:42
@kuilpd

kuilpd commented Jul 1, 2026

Copy link
Copy Markdown
Author

I based this patch on #182 because it needed the extended instructions support. However, it has regular unary and binary instructions that are not yet implemented in that branch, so I had to re-add the implementation so that I could run the tests. These extra function should be removed/updated to their versions in the main branch when merging with it.

@asavonic asavonic force-pushed the dxsa-mlir-sampler branch 2 times, most recently from cc0bf04 to 161d8b2 Compare July 2, 2026 08:06
@kuilpd kuilpd force-pushed the kuilpd/dxsa-mlir-bufinfo-resinfo-samplepos-sampleinfo branch from 19f5609 to 8020ab3 Compare July 2, 2026 10:51
@kuilpd kuilpd changed the base branch from dxsa-mlir-sampler to dxsa-mlir July 2, 2026 10:52
@kuilpd

kuilpd commented Jul 2, 2026

Copy link
Copy Markdown
Author

@asavonic
Rebased on current dxsa-mlir.
Due to changes in verifyInstructionLength I had to adjust some tests that output unparsed instructions. Any instruction that is recognized from the opcode (but with no parsing implemented) will now be printed as dxsa.instruction "name" instead of unknown tokens. Unknown tokens are now printed only when parsing of implemented instruction fails in some way.

@asavonic asavonic merged commit 6fc45dc into dxsa-mlir Jul 2, 2026
5 checks passed
asavonic pushed a commit that referenced this pull request Jul 2, 2026
This patch also changes `verifyInstructionLength` so that it fails only if
parsed operands length is greater than the specified instruction length in the
opcode, and it skips the unparsed tokens if the specified instruction length is
longer than parsed operands. This matches the behavior of `dxbc2dxil`, which
doesn't check if there are unparsed tokens left, and simply moves further to
parse tokens past the specified instruction length. `FXC` can output `samplepos`
with an extra token in the end, not sure about other instructions.
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