-
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] add
vk::ext_result_id<T>
type (#4192)
As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds vk::ext_result_id<T> type. We must use it for a variable definition or a function parameter. It means we do not consider it as a physical storage. Instead, it will be a result id of the instruction. Related to #3919
- Loading branch information
Showing
13 changed files
with
146 additions
and
16 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
20 changes: 20 additions & 0 deletions
20
tools/clang/test/CodeGenSPIRV/spv.intrinsic.result_id.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,20 @@ | ||
// RUN: %dxc -T cs_6_0 -E main | ||
|
||
[[vk::ext_instruction(/* OpLoad */ 61)]] | ||
vk::ext_result_id<float> load([[vk::ext_reference]] float pointer, | ||
[[vk::ext_literal]] int memoryOperands); | ||
|
||
[[vk::ext_instruction(/* OpStore */ 62)]] | ||
void store([[vk::ext_reference]] float pointer, | ||
vk::ext_result_id<float> value, | ||
[[vk::ext_literal]] int memoryOperands); | ||
|
||
[numthreads(1,1,1)] | ||
void main() { | ||
float foo, bar; | ||
|
||
//CHECK: [[foo_value:%\w+]] = OpLoad %float %foo None | ||
//CHECK: OpStore %bar [[foo_value]] Volatile | ||
vk::ext_result_id<float> foo_value = load(foo, /* None */ 0x0); | ||
store(bar, foo_value, /* Volatile */ 0x1); | ||
} |
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