-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2152 from KhronosGroup/fix-2143
Land PR 2143
- Loading branch information
Showing
14 changed files
with
314 additions
and
24 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
26 changes: 26 additions & 0 deletions
26
reference/opt/shaders-hlsl/asm/frag/array-of-structured-buffers.structured.fxconly.asm.frag
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 @@ | ||
struct Data | ||
{ | ||
float4 Color; | ||
}; | ||
|
||
StructuredBuffer<Data> Colors[2] : register(t0); | ||
|
||
static float4 out_var_SV_Target; | ||
|
||
struct SPIRV_Cross_Output | ||
{ | ||
float4 out_var_SV_Target : SV_Target0; | ||
}; | ||
|
||
void frag_main() | ||
{ | ||
out_var_SV_Target = Colors[1][3u].Color; | ||
} | ||
|
||
SPIRV_Cross_Output main() | ||
{ | ||
frag_main(); | ||
SPIRV_Cross_Output stage_output; | ||
stage_output.out_var_SV_Target = out_var_SV_Target; | ||
return stage_output; | ||
} |
26 changes: 26 additions & 0 deletions
26
reference/opt/shaders-hlsl/asm/frag/structured-buffer.structured.asm.frag
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 @@ | ||
struct Data | ||
{ | ||
float4 Color; | ||
}; | ||
|
||
StructuredBuffer<Data> Colors : register(t0); | ||
|
||
static float4 out_var_SV_Target; | ||
|
||
struct SPIRV_Cross_Output | ||
{ | ||
float4 out_var_SV_Target : SV_Target0; | ||
}; | ||
|
||
void frag_main() | ||
{ | ||
out_var_SV_Target = Colors[3u].Color; | ||
} | ||
|
||
SPIRV_Cross_Output main() | ||
{ | ||
frag_main(); | ||
SPIRV_Cross_Output stage_output; | ||
stage_output.out_var_SV_Target = out_var_SV_Target; | ||
return stage_output; | ||
} |
26 changes: 26 additions & 0 deletions
26
reference/shaders-hlsl/asm/frag/array-of-structured-buffers.structured.fxconly.asm.frag
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 @@ | ||
struct Data | ||
{ | ||
float4 Color; | ||
}; | ||
|
||
StructuredBuffer<Data> Colors[2] : register(t0); | ||
|
||
static float4 out_var_SV_Target; | ||
|
||
struct SPIRV_Cross_Output | ||
{ | ||
float4 out_var_SV_Target : SV_Target0; | ||
}; | ||
|
||
void frag_main() | ||
{ | ||
out_var_SV_Target = Colors[1][3u].Color; | ||
} | ||
|
||
SPIRV_Cross_Output main() | ||
{ | ||
frag_main(); | ||
SPIRV_Cross_Output stage_output; | ||
stage_output.out_var_SV_Target = out_var_SV_Target; | ||
return stage_output; | ||
} |
26 changes: 26 additions & 0 deletions
26
reference/shaders-hlsl/asm/frag/structured-buffer.structured.asm.frag
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 @@ | ||
struct Data | ||
{ | ||
float4 Color; | ||
}; | ||
|
||
StructuredBuffer<Data> Colors : register(t0); | ||
|
||
static float4 out_var_SV_Target; | ||
|
||
struct SPIRV_Cross_Output | ||
{ | ||
float4 out_var_SV_Target : SV_Target0; | ||
}; | ||
|
||
void frag_main() | ||
{ | ||
out_var_SV_Target = Colors[3u].Color; | ||
} | ||
|
||
SPIRV_Cross_Output main() | ||
{ | ||
frag_main(); | ||
SPIRV_Cross_Output stage_output; | ||
stage_output.out_var_SV_Target = out_var_SV_Target; | ||
return stage_output; | ||
} |
55 changes: 55 additions & 0 deletions
55
shaders-hlsl/asm/frag/array-of-structured-buffers.structured.fxconly.asm.frag
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,55 @@ | ||
; SPIR-V | ||
; Version: 1.3 | ||
; Generator: Google spiregg; 0 | ||
; Bound: 25 | ||
; Schema: 0 | ||
OpCapability Shader | ||
OpExtension "SPV_GOOGLE_hlsl_functionality1" | ||
OpExtension "SPV_GOOGLE_user_type" | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint Fragment %main "main" %out_var_SV_Target | ||
OpExecutionMode %main OriginUpperLeft | ||
OpSource HLSL 660 | ||
OpName %type_StructuredBuffer_Data "type.StructuredBuffer.Data" | ||
OpName %Data "Data" | ||
OpMemberName %Data 0 "Color" | ||
OpName %Colors "Colors" | ||
OpName %out_var_SV_Target "out.var.SV_Target" | ||
OpName %main "main" | ||
OpDecorateString %out_var_SV_Target UserSemantic "SV_Target" | ||
OpDecorate %out_var_SV_Target Location 0 | ||
OpDecorate %Colors DescriptorSet 0 | ||
OpDecorate %Colors Binding 0 | ||
OpMemberDecorate %Data 0 Offset 0 | ||
OpDecorate %_runtimearr_Data ArrayStride 16 | ||
OpMemberDecorate %type_StructuredBuffer_Data 0 Offset 0 | ||
OpMemberDecorate %type_StructuredBuffer_Data 0 NonWritable | ||
OpDecorate %type_StructuredBuffer_Data BufferBlock | ||
OpDecorateString %Colors UserTypeGOOGLE "structuredbuffer:<Data>" | ||
%int = OpTypeInt 32 1 | ||
%int_1 = OpConstant %int 1 | ||
%int_0 = OpConstant %int 0 | ||
%uint = OpTypeInt 32 0 | ||
%uint_3 = OpConstant %uint 3 | ||
%uint_2 = OpConstant %uint 2 | ||
%float = OpTypeFloat 32 | ||
%v4float = OpTypeVector %float 4 | ||
%Data = OpTypeStruct %v4float | ||
%_runtimearr_Data = OpTypeRuntimeArray %Data | ||
%type_StructuredBuffer_Data = OpTypeStruct %_runtimearr_Data | ||
%_arr_type_StructuredBuffer_Data_uint_2 = OpTypeArray %type_StructuredBuffer_Data %uint_2 | ||
%_ptr_Uniform__arr_type_StructuredBuffer_Data_uint_2 = OpTypePointer Uniform %_arr_type_StructuredBuffer_Data_uint_2 | ||
%_ptr_Output_v4float = OpTypePointer Output %v4float | ||
%void = OpTypeVoid | ||
%20 = OpTypeFunction %void | ||
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float | ||
%Colors = OpVariable %_ptr_Uniform__arr_type_StructuredBuffer_Data_uint_2 Uniform | ||
%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output | ||
%main = OpFunction %void None %20 | ||
%22 = OpLabel | ||
%23 = OpAccessChain %_ptr_Uniform_v4float %Colors %int_1 %int_0 %uint_3 %int_0 | ||
%24 = OpLoad %v4float %23 | ||
OpStore %out_var_SV_Target %24 | ||
OpReturn | ||
OpFunctionEnd |
52 changes: 52 additions & 0 deletions
52
shaders-hlsl/asm/frag/structured-buffer.structured.asm.frag
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,52 @@ | ||
; SPIR-V | ||
; Version: 1.3 | ||
; Generator: Google spiregg; 0 | ||
; Bound: 22 | ||
; Schema: 0 | ||
OpCapability Shader | ||
OpExtension "SPV_GOOGLE_hlsl_functionality1" | ||
OpExtension "SPV_GOOGLE_user_type" | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint Fragment %main "main" %out_var_SV_Target | ||
OpExecutionMode %main OriginUpperLeft | ||
OpSource HLSL 660 | ||
OpName %type_StructuredBuffer_Data "type.StructuredBuffer.Data" | ||
OpName %Data "Data" | ||
OpMemberName %Data 0 "Color" | ||
OpName %Colors "Colors" | ||
OpName %out_var_SV_Target "out.var.SV_Target" | ||
OpName %main "main" | ||
OpDecorateString %out_var_SV_Target UserSemantic "SV_Target" | ||
OpDecorate %out_var_SV_Target Location 0 | ||
OpDecorate %Colors DescriptorSet 0 | ||
OpDecorate %Colors Binding 0 | ||
OpMemberDecorate %Data 0 Offset 0 | ||
OpDecorate %_runtimearr_Data ArrayStride 16 | ||
OpMemberDecorate %type_StructuredBuffer_Data 0 Offset 0 | ||
OpMemberDecorate %type_StructuredBuffer_Data 0 NonWritable | ||
OpDecorate %type_StructuredBuffer_Data BufferBlock | ||
OpDecorateString %Colors UserTypeGOOGLE "structuredbuffer:<Data>" | ||
%int = OpTypeInt 32 1 | ||
%int_0 = OpConstant %int 0 | ||
%uint = OpTypeInt 32 0 | ||
%uint_3 = OpConstant %uint 3 | ||
%float = OpTypeFloat 32 | ||
%v4float = OpTypeVector %float 4 | ||
%Data = OpTypeStruct %v4float | ||
%_runtimearr_Data = OpTypeRuntimeArray %Data | ||
%type_StructuredBuffer_Data = OpTypeStruct %_runtimearr_Data | ||
%_ptr_Uniform_type_StructuredBuffer_Data = OpTypePointer Uniform %type_StructuredBuffer_Data | ||
%_ptr_Output_v4float = OpTypePointer Output %v4float | ||
%void = OpTypeVoid | ||
%17 = OpTypeFunction %void | ||
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float | ||
%Colors = OpVariable %_ptr_Uniform_type_StructuredBuffer_Data Uniform | ||
%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output | ||
%main = OpFunction %void None %17 | ||
%19 = OpLabel | ||
%20 = OpAccessChain %_ptr_Uniform_v4float %Colors %int_0 %uint_3 %int_0 | ||
%21 = OpLoad %v4float %20 | ||
OpStore %out_var_SV_Target %21 | ||
OpReturn | ||
OpFunctionEnd |
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
Oops, something went wrong.