Skip to content

HLSL 6.0 ... 6.9 and GPUTexture for d3d12#9077

Open
soufianekhiat wants to merge 47 commits intohalide:mainfrom
soufianekhiat:sk/hlsl_6
Open

HLSL 6.0 ... 6.9 and GPUTexture for d3d12#9077
soufianekhiat wants to merge 47 commits intohalide:mainfrom
soufianekhiat:sk/hlsl_6

Conversation

@soufianekhiat
Copy link
Copy Markdown

@soufianekhiat soufianekhiat commented Mar 25, 2026

Breaking changes

  • Add support for HLSL 6.0 ... 6.9
  • Add support for GPU Texture on d3d12compute

Details:

  • Emit "//HALIDE_D3D12_SM XX" on HLSL version and being parsed to avoid complex infrastructure just to get that version KISS.
  • Co-authored-by: Claude (all code formating, comments and mini_dxc.cpp was 100% written by Claude Opus 4.6)

Checklist

  • Tests added or updated (not required for docs, CI config, or typo fixes)
  • Documentation updated (if public API changed)
  • Python bindings updated (if public API changed)
  • Benchmarks are included here if the change is intended to affect performance.
  • Commits include AI attribution where applicable (see Code of Conduct)

@soufianekhiat
Copy link
Copy Markdown
Author

Is that possible to have a maintainer trigger the CI for this one please?

@alexreinking
Copy link
Copy Markdown
Member

We don't seem to have any d3d12compute coverage on the buildbots. I'll need to add that prior to reviewing/merging this.

@soufianekhiat
Copy link
Copy Markdown
Author

We don't seem to have any d3d12compute coverage on the buildbots. I'll need to add that prior to reviewing/merging this.

Added this to tests HLSL 6.x features:
test/correctness/cross_compilation.cpp
https://github.com/halide/Halide/pull/9077/changes#diff-8155bdbbeeb25a66365bbd00273602683aa90a2f220c98dbaa8e15f6f988403e

@alexreinking alexreinking added the dev_meeting Topic to be discussed at the next dev meeting label Mar 26, 2026
alexreinking added a commit to halide/build_bot that referenced this pull request Mar 27, 2026
@alexreinking
Copy link
Copy Markdown
Member

I've modified the buildbots to test d3d12compute_sm65, which is the highest version both Windows bots support. We'll see how this goes! I notice that several features here are gated behind higher versions than that. I've tagged this dev_meeting so we can discuss a testing plan.

@alexreinking
Copy link
Copy Markdown
Member

Many tests require strict_float... it seemed easy enough to implement following the precise hint and copying the Vulkan backend's approach to lowering. The only tricky business is that we need a different key than the given expression (or we'd need to implement a bunch of strict_OP intrinsics with precise arguments).

@soufianekhiat soufianekhiat changed the title HLSL 6.0 ... 6.9 HLSL 6.0 ... 6.9 and GPUTexture for d3d12 Mar 27, 2026
@alexreinking
Copy link
Copy Markdown
Member

@soufianekhiat -- can you look at the codegen failures here? There seem to be two classes of bug:

  1. Globals have clashing names. I'm not sure what the best resolution here is.
  2. "as" casts are misspelled, e.g. asfloat32_t instead of asfloat

@soufianekhiat
Copy link
Copy Markdown
Author

@soufianekhiat -- can you look at the codegen failures here? There seem to be two classes of bug:

  1. Globals have clashing names. I'm not sure what the best resolution here is.
  2. "as" casts are misspelled, e.g. asfloat32_t instead of asfloat

Do we have tests for codegen? I just run locally the one I think are relevant.

@alexreinking
Copy link
Copy Markdown
Member

Do we have tests for codegen? I just run locally the one I think are relevant.

We don't have (many) compile-only tests... I'm just looking at the buildbot failures here; the issues are with invalid code being generated which is why I called them "codegen failures".

Also, I'm noticing that there's some signed/unsigned mismatch happening somewhere.

https://buildbot.halide-lang.org/master/#/builders/391/builds/385

@alexreinking alexreinking mentioned this pull request Mar 28, 2026
5 tasks
@alexreinking
Copy link
Copy Markdown
Member

@soufianekhiat - I've opened #9080 to test patches that are generally needed to fix the D3D12 backend, even for HLSL <6.0. That should provide a more stable foundation for this PR, which should be scoped to extending support to 6.0-6.9, rather than also including fundamental bug-fixes.

@alexreinking
Copy link
Copy Markdown
Member

@soufianekhiat - the HLSL 5.1 fixes are in, so please rebase/merge with main.

@soufianekhiat
Copy link
Copy Markdown
Author

Thanks

soufianekhiat and others added 2 commits April 3, 2026 10:47
Co-authored-by: Alex Reinking <alex.reinking@gmail.com>
Co-authored-by: Alex Reinking <alex.reinking@gmail.com>
Co-authored-by: Alex Reinking <alex.reinking@gmail.com>
Copy link
Copy Markdown
Contributor

@shoaibkamil shoaibkamil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this! I took a first pass over the PR, and it's getting close to being finished. I found a few issues, however, so please take a look.

@soufianekhiat
Copy link
Copy Markdown
Author

soufianekhiat commented Apr 5, 2026

Updated the validation script for that PR found new issues:
https://gist.github.com/soufianekhiat/2a8d174b366b69ea4221c18a15711f6a
Make sure all generated shaders works and compile with dxc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev_meeting Topic to be discussed at the next dev meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants