-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[spirv] Allow aliasing builtin variables (#1691)
This behavior is supported by FXC. Fixes #1690
- Loading branch information
1 parent
d75f96a
commit de62ed4
Showing
5 changed files
with
62 additions
and
2 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
21 changes: 21 additions & 0 deletions
21
tools/clang/test/CodeGenSPIRV/spirv.interface.alias-builtin.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,21 @@ | ||
// Run: %dxc -T ps_6_0 -E main | ||
|
||
// CHECK: OpEntryPoint Fragment %main "main" %gl_FragCoord %out_var_SV_Target | ||
|
||
// CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input | ||
// CHECK-NOT: {{%\d+}} = OpVariable %_ptr_Input_v4float Input | ||
|
||
struct PSInput { | ||
float4 a : SV_Position; | ||
float4 b : SV_Position; | ||
}; | ||
|
||
// CHECK: [[a:%\d+]] = OpLoad %v4float %gl_FragCoord | ||
// CHECK-NEXT: [[b:%\d+]] = OpLoad %v4float %gl_FragCoord | ||
// CHECK-NEXT: {{%\d+}} = OpCompositeConstruct %PSInput [[a]] [[b]] | ||
|
||
float4 main(PSInput input) : SV_Target | ||
{ | ||
return input.a + input.b; | ||
} | ||
|
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