HLSL 6.0 ... 6.9 and GPUTexture for d3d12#9077
HLSL 6.0 ... 6.9 and GPUTexture for d3d12#9077soufianekhiat wants to merge 53 commits intohalide:mainfrom
Conversation
|
Is that possible to have a maintainer trigger the CI for this one please? |
|
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: |
|
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 |
|
Many tests require |
|
@soufianekhiat -- can you look at the codegen failures here? There seem to be two classes of bug:
|
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 |
|
@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. |
|
@soufianekhiat - the HLSL 5.1 fixes are in, so please rebase/merge with main. |
|
Thanks |
Co-authored-by: Alex Reinking <alex.reinking@gmail.com>
Co-authored-by: Alex Reinking <alex.reinking@gmail.com>
shoaibkamil
left a comment
There was a problem hiding this comment.
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.
|
Updated the validation script for that PR found new issues: |
|
@alexreinking @shoaibkamil @slomp Let me know if that changes fits. |
| D3D12_RESOURCE_DESC desc = {}; | ||
| { | ||
| desc.Alignment = 0; | ||
| desc.MipLevels = 1; |
There was a problem hiding this comment.
Not particularly familiar with texture support in Halide itself, so I just want to make sure that MipLevels = 1 is expected/appropriated here.
| Upload, | ||
| ReadBack | ||
| ReadBack, | ||
| Texture |
There was a problem hiding this comment.
I think retrofitting textures into the buffer interface will lead to trouble eventually.
Technically, things like Upload/Readback and ReadOnly/ReadWrite are properties of the buffer that are also applicable (with their own quirks) to textures.
Is this how the other Halide back-ends implement textures (by just piggy-backing on the buffer interface)?
| namespace { | ||
|
|
||
| // Parse the SM version from a Halide-emitted HLSL source header. | ||
| // Returns e.g. 60 for "//HALIDE_D3D12_SM 60\n", or 0 if not present. |
There was a problem hiding this comment.
So, the HLSL code gen just emits a comment about the shader model?
I think it would be more useful to emit an actual #define HALIDE_D3D12_SM <version-number> instead.
This way, we can inject/patch code later on with preprocessor checks.
There was a problem hiding this comment.
It will be never be used by the code it will be just read by:
int parse_hlsl_sm_version(const char *source)
|
I'll give you and the other reviewers some time to discuss/address my points above, and once that's resolved, I'll give the runtime code another look. I think the kernel argument packing logic which I wrote originally has some fundamental flaws that I want to explore, and adding/mixing 64bits to it has raised some concerns I need to verify in the meanwhile. |
Breaking changes
Details:
Checklist