-
Notifications
You must be signed in to change notification settings - Fork 686
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[spirv] support vk::ext_execution_mode_id(..) (#4190)
As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds `vk::ext_execution_mode_id(..)` intrinsic function. In addition, it allows users to enable capabilites and extensions via `vk::ext_execution_mode[_id](..)` using `[[vk::ext_capability(..)]]` and `[[vk::ext_extension(..)]]`. Related to #3919
- Loading branch information
Showing
11 changed files
with
133 additions
and
61 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
7 changes: 5 additions & 2 deletions
7
tools/clang/test/CodeGenSPIRV/spv.intrinsicExecutionMode.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,14 +1,17 @@ | ||
// RUN: %dxc -T ps_6_0 -E main -spirv | ||
|
||
|
||
// CHECK: OpCapability ShaderClockKHR | ||
// CHECK: OpExtension "SPV_KHR_shader_clock" | ||
// CHECK: OpExecutionMode {{%\w+}} StencilRefReplacingEXT | ||
// CHECK: OpExecutionMode {{%\w+}} SubgroupSize 32 | ||
// CHECK: OpDecorate {{%\w+}} BuiltIn FragStencilRefEXT | ||
|
||
[[vk::ext_decorate(11, 5014)]] | ||
int main() : SV_Target0 { | ||
|
||
[[vk::ext_capability(5055)]] | ||
[[vk::ext_extension("SPV_KHR_shader_clock")]] | ||
vk::ext_execution_mode(/*StencilRefReplacingEXT*/5027); | ||
|
||
vk::ext_execution_mode(/*SubgroupSize*/35, 32); | ||
return 3; | ||
} |
16 changes: 16 additions & 0 deletions
16
tools/clang/test/CodeGenSPIRV/spv.intrinsicExecutionModeId.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %dxc -T ps_6_0 -E main -spirv | ||
|
||
// CHECK: OpCapability ShaderClockKHR | ||
// CHECK: OpExtension "SPV_KHR_shader_clock" | ||
// CHECK: OpExecutionModeId {{%\w+}} LocalSizeId %uint_8 %uint_8 %uint_8 | ||
// CHECK: OpExecutionModeId {{%\w+}} LocalSizeHintId %uint_4 %uint_4 %uint_4 | ||
|
||
int main() : SV_Target0 { | ||
vk::ext_execution_mode_id(/*LocalSizeId*/38, 8, 8, 8); | ||
|
||
[[vk::ext_capability(5055)]] | ||
[[vk::ext_extension("SPV_KHR_shader_clock")]] | ||
vk::ext_execution_mode_id(/*LocalSizeHintId*/39, 4, 4, 4); | ||
|
||
return 3; | ||
} |
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