#!amber # Copyright 2020 The Amber Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # AmberScript generated by GraphicsFuzz SHADER vertex gfz_vert PASSTHROUGH # Derived from the following GLSL. # Fragment shader GLSL: # #version 310 es # precision highp float; # # layout(location = 0) out vec4 _GLF_color; # # layout(set = 0, binding = 0) uniform buf0 { # mat2x3 m; # }; # void main() { # _GLF_color = vec4(m[1][2], 0.0, 0.0, 1.0); # } SHADER fragment gfz_frag SPIRV-ASM ; SPIR-V ; Version: 1.0 ; Generator: Khronos Glslang Reference Front End; 7 ; Bound: 26 ; Schema: 0 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %9 OpExecutionMode %4 OriginUpperLeft OpSource ESSL 310 OpName %4 "main" OpName %9 "_GLF_color" OpName %12 "buf0" OpMemberName %12 0 "m" OpName %14 "" OpDecorate %9 Location 0 OpMemberDecorate %12 0 ColMajor OpMemberDecorate %12 0 Offset 0 OpMemberDecorate %12 0 MatrixStride 16 OpDecorate %12 Block OpDecorate %14 DescriptorSet 0 OpDecorate %14 Binding 0 %2 = OpTypeVoid %3 = OpTypeFunction %2 %6 = OpTypeFloat 32 %7 = OpTypeVector %6 4 %8 = OpTypePointer Output %7 %9 = OpVariable %8 Output %10 = OpTypeVector %6 3 %11 = OpTypeMatrix %10 2 %12 = OpTypeStruct %11 %13 = OpTypePointer Uniform %12 %14 = OpVariable %13 Uniform %15 = OpTypeInt 32 1 %16 = OpConstant %15 0 %17 = OpConstant %15 1 %18 = OpTypeInt 32 0 %19 = OpConstant %18 2 %20 = OpTypePointer Uniform %6 %23 = OpConstant %6 0 %24 = OpConstant %6 1 %4 = OpFunction %2 None %3 %5 = OpLabel %21 = OpAccessChain %20 %14 %16 %17 %19 %22 = OpLoad %6 %21 %25 = OpCompositeConstruct %7 %22 %23 %23 %24 OpStore %9 %25 OpReturn OpFunctionEnd END BUFFER framebuffer FORMAT B8G8R8A8_UNORM BUFFER matrix DATA_TYPE mat2x3 DATA 1.0 64.0 128.0 200.0 220.0 255.0 END PIPELINE graphics gfz_pipeline ATTACH gfz_vert ATTACH gfz_frag FRAMEBUFFER_SIZE 256 256 BIND BUFFER framebuffer AS color LOCATION 0 BIND BUFFER matrix AS uniform DESCRIPTOR_SET 0 BINDING 0 END CLEAR_COLOR gfz_pipeline 0 0 0 255 CLEAR gfz_pipeline RUN gfz_pipeline DRAW_RECT POS 0 0 SIZE 256 256 EXPECT framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255