Skip to content

[Diag] Diagnose missing numthreads in compute shaders#6021

Merged
bogner merged 2 commits into
mainfrom
users/bogner/spr/diag-diagnose-missing-numthreads-in-compute-shaders
Nov 16, 2023
Merged

[Diag] Diagnose missing numthreads in compute shaders#6021
bogner merged 2 commits into
mainfrom
users/bogner/spr/diag-diagnose-missing-numthreads-in-compute-shaders

Conversation

@bogner
Copy link
Copy Markdown
Collaborator

@bogner bogner commented Nov 15, 2023

Currently we error out in validation if a compute shader doesn't have
a numthreads attribute:

<source>:2: error: Declared Thread Group X size 2833376888 outside valid range [1..1024].
<source>:2: error: Declared Thread Group Y size 21956 outside valid range [1..1024].
<source>:2: error: Declared Thread Group Z size 2833381336 outside valid range [1..64].
<source>:2: error: Declared Thread Group Count 3863291136 (X*Y*Z) is beyond the valid maximum of 1024.

Instead, diagnose this in Sema like we do for mesh and amplitude shaders

Created using spr 1.3.5
Comment thread tools/clang/test/CodeGenSPIRV_Lit/attribute.numthreads.missing.hlsl
@bogner bogner requested a review from llvm-beanz November 15, 2023 22:53
Copy link
Copy Markdown
Collaborator

@pow2clk pow2clk left a comment

Choose a reason for hiding this comment

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

It looks good, but I'm making an argument over on #6023 that maybe you should reword the error message that this change uses. Do with that information what you will!

bogner added a commit to bogner/DirectXShaderCompiler that referenced this pull request Nov 15, 2023
Currently we error out in validation if a compute shader doesn't have
a numthreads attribute:

```
<source>:2: error: Declared Thread Group X size 2833376888 outside valid range [1..1024].
<source>:2: error: Declared Thread Group Y size 21956 outside valid range [1..1024].
<source>:2: error: Declared Thread Group Z size 2833381336 outside valid range [1..64].
<source>:2: error: Declared Thread Group Count 3863291136 (X*Y*Z) is beyond the valid maximum of 1024.
```

Instead, diagnose this in Sema like we do for mesh and amplitude shaders

Pull Request: microsoft#6021
@bogner bogner merged commit 7c33007 into main Nov 16, 2023
@bogner bogner deleted the users/bogner/spr/diag-diagnose-missing-numthreads-in-compute-shaders branch November 16, 2023 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants