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 vert_shader PASSTHROUGH 17SHADER fragment frag_shader GLSL 18#version 430 19layout(location = 0) out vec4 color_out; 20void main() { 21 color_out = vec4(1.0, 0.0, 0.0, 1.0); 22} 23END 24 25BUFFER img_buf FORMAT B8G8R8A8_UNORM 26BUFFER dest_buf FORMAT B8G8R8A8_UNORM 27 28PIPELINE graphics my_pipeline 29 ATTACH vert_shader 30 ATTACH frag_shader 31 FRAMEBUFFER_SIZE 256 256 32 BIND BUFFER img_buf AS color LOCATION 0 33END 34 35RUN my_pipeline DRAW_RECT POS 0 0 SIZE 256 256 36EXPECT img_buf IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255 37COPY img_buf TO dest_buf 38EXPECT dest_buf IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255 39