1#!amber 2# Copyright 2019 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 16SHADER vertex vtex_shader GLSL 17#version 430 18layout(location = 0) in vec3 position; 19void main() { 20 gl_Position = vec4(position, 1.0); 21} 22END 23 24SHADER fragment frag_shader GLSL 25#version 430 26layout(location = 0) out vec4 final_color; 27void main() { 28 final_color = vec4(1.0, 0.0, 0.0, 1.0); 29} 30END 31 32BUFFER position_buf DATA_TYPE vec3<float> DATA 33-1 1 0 34-1 -1 0 35 1 1 0 36 1 -1 0 37-1 -1 0 38 1 1 0 39END 40 41BUFFER framebuffer FORMAT B8G8R8A8_UNORM 42 43PIPELINE graphics pipeline 44 ATTACH vtex_shader 45 ATTACH frag_shader 46 47 VERTEX_DATA position_buf LOCATION 0 48 FRAMEBUFFER_SIZE 250 250 49 BIND BUFFER framebuffer AS color LOCATION 0 50 51END 52 53RUN pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 6 54EXPECT framebuffer IDX 0 0 SIZE 250 250 EQ_RGBA 255 0 0 255 55