Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2021-01-07 12:28:06 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2021-01-07 12:50:29 +0300
commitfa76d0120344a4f9be99ea8c96791ae8cb70ede2 (patch)
tree7427db9b06abb3db4688d91c90b36a0463e512a7 /shaders-msl-no-opt
parentc8837d7d8069bfd2cbd7c25e38dbad252e38593a (diff)
MSL: Only consider builtin variables if they are part of IO interface.
Diffstat (limited to 'shaders-msl-no-opt')
-rw-r--r--shaders-msl-no-opt/asm/vert/duplicate-view-index.asm.vert66
1 files changed, 66 insertions, 0 deletions
diff --git a/shaders-msl-no-opt/asm/vert/duplicate-view-index.asm.vert b/shaders-msl-no-opt/asm/vert/duplicate-view-index.asm.vert
new file mode 100644
index 00000000..00ad1ee9
--- /dev/null
+++ b/shaders-msl-no-opt/asm/vert/duplicate-view-index.asm.vert
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ OpCapability MultiView
+ OpExtension "SPV_KHR_multiview"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %main "main" %_ %gl_ViewIndex
+ OpEntryPoint Vertex %main2 "main2" %_ %gl_ViewIndex2
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_multiview"
+ OpName %main "main"
+ OpName %gl_PerVertex "gl_PerVertex"
+ OpMemberName %gl_PerVertex 0 "gl_Position"
+ OpMemberName %gl_PerVertex 1 "gl_PointSize"
+ OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
+ OpMemberName %gl_PerVertex 3 "gl_CullDistance"
+ OpName %_ ""
+ OpName %gl_ViewIndex "gl_ViewIndex"
+ OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+ OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
+ OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
+ OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
+ OpDecorate %gl_PerVertex Block
+ OpDecorate %gl_ViewIndex BuiltIn ViewIndex
+ OpDecorate %gl_ViewIndex2 BuiltIn ViewIndex
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_arr_float_uint_1 = OpTypeArray %float %uint_1
+%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
+%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
+ %_ = OpVariable %_ptr_Output_gl_PerVertex Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Input_int = OpTypePointer Input %int
+%gl_ViewIndex = OpVariable %_ptr_Input_int Input
+%gl_ViewIndex2 = OpVariable %_ptr_Input_int Input
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %18 = OpLoad %int %gl_ViewIndex
+ %19 = OpConvertSToF %float %18
+ %20 = OpCompositeConstruct %v4float %19 %19 %19 %19
+ %22 = OpAccessChain %_ptr_Output_v4float %_ %int_0
+ OpStore %22 %20
+ OpReturn
+ OpFunctionEnd
+
+ %main2 = OpFunction %void None %3
+ %100 = OpLabel
+ %101 = OpLoad %int %gl_ViewIndex2
+ %102 = OpConvertSToF %float %101
+ %103 = OpCompositeConstruct %v4float %102 %102 %102 %102
+ %104 = OpAccessChain %_ptr_Output_v4float %_ %int_0
+ OpStore %104 %103
+
+ OpReturn
+ OpFunctionEnd