Skip to content

Shader: image atomics name a U32 element in the handle annotation - #525

Closed
spidercraft wants to merge 1 commit into
Marvisak:mainfrom
spidercraft:shader-image-atomics
Closed

spidercraft wants to merge 1 commit into
Marvisak:mainfrom
spidercraft:shader-image-atomics

Conversation

@spidercraft

Copy link
Copy Markdown

What

Typed texture handles were annotated as four F32 components, image atomics included. DXIL's image atomics are 32-bit integer ones, but a host that takes the element type from the handle annotation (vkd3d-proton's DXIL-to-SPIR-V) then emits a float OpAtomicUMax, which is invalid SPIR-V; NVIDIA's shader compiler (620.73 on Linux) crashes on it instead of failing the pipeline.

An image atomic's handle now names one U32 component (0x105), and the per-function handle cache is keyed by both annotation words, so a texture that is both read and updated atomically gets both handles. Other handles are unchanged. Independent of the Linux work, though found there.

Tested

  • Linux, RTX 5090, vkd3d-proton, Microsoft's DXC v1.9.2609: victory translate --pipelines over the title's shader archive completed (it crashed in the driver before): every emitted vertex, pixel and mesh program made a pipeline; the compute programs that do not are the ones requiring 64-lane waves. --validate counts unchanged.
  • cargo test -p victory-shader passes; Windows target type-checks with no diagnostics.

🤖 Generated with Claude Code

Typed texture handles were annotated as four F32 components, image
atomics included. DXIL's atomics are 32-bit integer ones, but
vkd3d-proton's DXIL-to-SPIR-V takes the element type from the
annotation and made OpAtomicUMax on a float, invalid SPIR-V that NVIDIA's
Linux shader compiler (620.73) crashed on: victory translate --pipelines
over shaders.rpf died in libnvidia-gpucomp. An image atomic's handle now
names one U32 component; the handle cache is keyed by both annotation
words, so a texture read and updated atomically gets both handles.

Tested: on Linux (RTX 5090, vkd3d-proton, DXC 1.9.2609) translate
--pipelines over shaders.rpf completes: 12272/12272 vertex and pixel,
8191/8191 mesh, 1372/1693 compute pipelines (the rest need 64-lane
waves); --validate counts unchanged (12172, 1670, 8129).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@spidercraft

Copy link
Copy Markdown
Author

Closing as a duplicate of #177, which fixed the same bug first: main already annotates an atomic's handle as U32, so keying the handle cache by the element type is the whole fix. #526 now carries #177's commits instead of this one.

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.

1 participant