5 ; Test a vertex shader with a ubo on the OpEntryPoint.
9 ; layout(binding = 0) uniform input_buffer
15 ; gl_Position = vec4(in_data[gl_VertexIndex], 0.0, 1.0);
18 %1 = OpExtInstImport "GLSL.std.450"
19 OpMemoryModel Logical GLSL450
20 OpEntryPoint Vertex %main "main" %_ %__0 %gl_VertexIndex
23 OpName %gl_PerVertex "gl_PerVertex"
24 OpMemberName %gl_PerVertex 0 "gl_Position"
25 OpMemberName %gl_PerVertex 1 "gl_PointSize"
26 OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
27 OpMemberName %gl_PerVertex 3 "gl_CullDistance"
29 OpName %input_buffer "input_buffer"
30 OpMemberName %input_buffer 0 "in_data"
32 OpName %gl_VertexIndex "gl_VertexIndex"
33 OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
34 OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
35 OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
36 OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
37 OpDecorate %gl_PerVertex Block
38 OpDecorate %_arr_v2float_uint_3 ArrayStride 16
39 OpMemberDecorate %input_buffer 0 Offset 0
40 OpDecorate %input_buffer Block
41 OpDecorate %__0 DescriptorSet 0
42 OpDecorate %__0 Binding 0
43 OpDecorate %gl_VertexIndex BuiltIn VertexIndex
45 %3 = OpTypeFunction %void
46 %float = OpTypeFloat 32
47 %v4float = OpTypeVector %float 4
48 %uint = OpTypeInt 32 0
49 %uint_1 = OpConstant %uint 1
50 %_arr_float_uint_1 = OpTypeArray %float %uint_1
51 %gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
52 %_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
53 %_ = OpVariable %_ptr_Output_gl_PerVertex Output
55 %int_0 = OpConstant %int 0
56 %v2float = OpTypeVector %float 2
57 %uint_3 = OpConstant %uint 3
58 %_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3
59 %input_buffer = OpTypeStruct %_arr_v2float_uint_3
60 %_ptr_Uniform_input_buffer = OpTypePointer Uniform %input_buffer
61 %__0 = OpVariable %_ptr_Uniform_input_buffer Uniform
62 %_ptr_Input_int = OpTypePointer Input %int
63 %gl_VertexIndex = OpVariable %_ptr_Input_int Input
64 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
65 %float_0 = OpConstant %float 0
66 %float_1 = OpConstant %float 1
67 %_ptr_Output_v4float = OpTypePointer Output %v4float
68 %main = OpFunction %void None %3
70 %24 = OpLoad %int %gl_VertexIndex
71 %26 = OpAccessChain %_ptr_Uniform_v2float %__0 %int_0 %24
72 %27 = OpLoad %v2float %26
73 %30 = OpCompositeExtract %float %27 0
74 %31 = OpCompositeExtract %float %27 1
75 %32 = OpCompositeConstruct %v4float %30 %31 %float_0 %float_1
76 %34 = OpAccessChain %_ptr_Output_v4float %_ %int_0
82 layout(location = 0) out vec4 outColor;
84 outColor = vec4(0.5, 0.5, 0.5, 0.5);
88 0/R8G8_SNORM 1/R8G8B8_UNORM
94 uniform ubo 0:0 float 0 -1.0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 -1.0 1.0
96 draw arrays TRIANGLE_LIST 0 3
98 probe rect rgba (0, 0, 125, 125) (0.5 0.5 0.5 0.5)
99 probe rect rgba (125, 125, 125, 125) (0.0 0.0 0.0 0.0)