-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
Optional
, Tuple
and bool
to be used in varying input/outp…
…ut. (#5889) * Allow `Optional` and `Tuple` to be used in varying input/output. * Fix. * format code * Fix. * Fix test. * Fix. * enhance test. * Fix. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
245 additions
and
51 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//TEST:SIMPLE(filecheck=CHECK): -target spirv | ||
// CHECK: OpVectorTimesMatrix | ||
|
||
struct Vertex | ||
{ | ||
float4x4 m; | ||
float4 pos; | ||
} | ||
|
||
struct VertexOut | ||
{ | ||
float4 pos : SV_Position; | ||
float4 color; | ||
} | ||
|
||
[shader("vertex")] | ||
VertexOut vertMain(Vertex v) | ||
{ | ||
VertexOut o; | ||
o.pos = mul(v.m, v.pos); | ||
o.color = v.pos; | ||
return o; | ||
} |
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,26 @@ | ||
//TEST:SIMPLE(filecheck=CHECK): -target spirv | ||
|
||
// Test that we can use Optional<T> or bool types in varying input or outputs. | ||
|
||
// CHECK: OpDecorate %i_inA_value Location 0 | ||
// CHECK: OpDecorate %i_inA_hasValue Location 1 | ||
// CHECK: OpDecorate %entryPointParam_vertMain_a_value Location 0 | ||
// CHECK: OpDecorate %entryPointParam_vertMain_a_hasValue Location 1 | ||
|
||
struct VIn { | ||
Optional<float> inA; | ||
} | ||
|
||
struct VSOut { | ||
Optional<float> a; | ||
bool outputValues[3]; | ||
}; | ||
|
||
[shader("vertex")] | ||
VSOut vertMain(VIn i) | ||
{ | ||
VSOut o; | ||
o.a = i.inA; | ||
o.outputValues = { true, false, true }; | ||
return o; | ||
} |