1#!amber 2# Copyright 2022 The Amber Authors. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16DEVICE_EXTENSION VK_EXT_index_type_uint8 17 18SHADER vertex vert_shader PASSTHROUGH 19SHADER fragment frag_shader GLSL 20#version 430 21layout(location = 0) out vec4 color_out; 22void main() { 23 color_out = vec4(0.0, 1.0, 0.0, 1.0); 24} 25END 26 27BUFFER position DATA_TYPE vec4<float> DATA 28-1.0 1.0 0.0 1.0 29 1.0 1.0 0.0 1.0 30 1.0 -1.0 0.0 1.0 31-1.0 -1.0 0.0 1.0 32END 33 34BUFFER indices DATA_TYPE uint8 DATA 353 2 1 0 36END 37 38IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 39 40PIPELINE graphics pipeline 41 ATTACH vert_shader 42 ATTACH frag_shader 43 VERTEX_DATA position LOCATION 0 44 INDEX_DATA indices 45 FRAMEBUFFER_SIZE 64 64 46 BIND BUFFER framebuffer AS color LOCATION 0 47END 48 49RUN pipeline DRAW_ARRAY AS TRIANGLE_FAN INDEXED START_IDX 0 COUNT 4 50EXPECT framebuffer IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255 51