1 // Copyright 2018 The Amber Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef SRC_SHADER_DATA_H_ 16 #define SRC_SHADER_DATA_H_ 17 18 #include <cstdint> 19 20 namespace amber { 21 22 const char kPassThroughShader[] = R"(; SPIR-V 23 ; Version: 1.0 24 ; Generator: Khronos Glslang Reference Front End; 7 25 ; Bound: 21 26 ; Schema: 0 27 OpCapability Shader 28 %1 = OpExtInstImport "GLSL.std.450" 29 OpMemoryModel Logical GLSL450 30 OpEntryPoint Vertex %main "main" %_ %position 31 OpSource GLSL 430 32 OpName %main "main" 33 OpName %gl_PerVertex "gl_PerVertex" 34 OpMemberName %gl_PerVertex 0 "gl_Position" 35 OpMemberName %gl_PerVertex 1 "gl_PointSize" 36 OpMemberName %gl_PerVertex 2 "gl_ClipDistance" 37 OpName %_ "" 38 OpName %position "position" 39 OpMemberDecorate %gl_PerVertex 0 BuiltIn Position 40 OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize 41 OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance 42 OpDecorate %gl_PerVertex Block 43 OpDecorate %position Location 0 44 %void = OpTypeVoid 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 52 %_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex 53 %_ = OpVariable %_ptr_Output_gl_PerVertex Output 54 %int = OpTypeInt 32 1 55 %int_0 = OpConstant %int 0 56 %_ptr_Input_v4float = OpTypePointer Input %v4float 57 %position = OpVariable %_ptr_Input_v4float Input 58 %_ptr_Output_v4float = OpTypePointer Output %v4float 59 %main = OpFunction %void None %3 60 %5 = OpLabel 61 %18 = OpLoad %v4float %position 62 %20 = OpAccessChain %_ptr_Output_v4float %_ %int_0 63 OpStore %20 %18 64 OpReturn 65 OpFunctionEnd)"; 66 67 } // namespace amber 68 69 #endif // SRC_SHADER_DATA_H_ 70