forked from microsoft/DirectXShaderCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[spirv] use OpIsHelperInvocation for [[vk::HelperInvocation]] (micros…
…oft#4172) For Vulkan 1.2 or less, we must not use HelperInvocation BuiltIn decoration. Instread, for a variable with `[[vk::HelperInvocation]]` attribute, we have to use `OpIsHelperInvocation` instruction: - Create a variable (with Input storage class) - In the module initialization, execute `OpIsHelperInvocation` instruction and store the result in the variable
- Loading branch information
Showing
19 changed files
with
177 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
tools/clang/test/CodeGenSPIRV/spirv.builtin.helper-invocation.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
// RUN: %dxc -T ps_6_0 -E main | ||
|
||
// CHECK: OpEntryPoint Fragment | ||
// CHECK-SAME: %gl_HelperInvocation | ||
// CHECK-NOT: OpDecorate {{%\w+}} BuiltIn HelperInvocation | ||
|
||
// CHECK: OpDecorate %gl_HelperInvocation BuiltIn HelperInvocation | ||
|
||
// CHECK: %gl_HelperInvocation = OpVariable %_ptr_Input_bool Input | ||
// CHECK: %HelperInvocation = OpVariable %_ptr_Private_bool Private | ||
|
||
float4 main([[vk::builtin("HelperInvocation")]] bool isHI : HI) : SV_Target { | ||
// CHECK: [[val:%\d+]] = OpLoad %bool %gl_HelperInvocation | ||
// CHECK: [[val:%\d+]] = OpLoad %bool %HelperInvocation | ||
// CHECK-NEXT: OpStore %param_var_isHI [[val]] | ||
float ret = 1.0; | ||
|
||
if (isHI) ret = 2.0; | ||
|
||
return ret; | ||
} | ||
// CHECK: %module_init = OpFunction %void None | ||
// CHECK: %module_init_bb = OpLabel | ||
// CHECK: [[HelperInvocation:%\d+]] = OpIsHelperInvocationEXT %bool | ||
// CHECK-NEXT: OpStore %HelperInvocation [[HelperInvocation]] |
Oops, something went wrong.