1e5c31af7Sopenharmony_ci#!amber 2e5c31af7Sopenharmony_ci# Copyright 2019 The Amber Authors. 3e5c31af7Sopenharmony_ci# 4e5c31af7Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 5e5c31af7Sopenharmony_ci# you may not use this file except in compliance with the License. 6e5c31af7Sopenharmony_ci# You may obtain a copy of the License at 7e5c31af7Sopenharmony_ci# 8e5c31af7Sopenharmony_ci# https://www.apache.org/licenses/LICENSE-2.0 9e5c31af7Sopenharmony_ci# 10e5c31af7Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 11e5c31af7Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 12e5c31af7Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13e5c31af7Sopenharmony_ci# See the License for the specific language governing permissions and 14e5c31af7Sopenharmony_ci# limitations under the License. 15e5c31af7Sopenharmony_ci 16e5c31af7Sopenharmony_ciSHADER vertex vtex_shader GLSL 17e5c31af7Sopenharmony_ci#version 430 18e5c31af7Sopenharmony_cilayout(location = 0) in vec3 position; 19e5c31af7Sopenharmony_civoid main() { 20e5c31af7Sopenharmony_ci gl_Position = vec4(position, 1.0); 21e5c31af7Sopenharmony_ci} 22e5c31af7Sopenharmony_ciEND 23e5c31af7Sopenharmony_ci 24e5c31af7Sopenharmony_ciSHADER fragment frag_shader GLSL 25e5c31af7Sopenharmony_ci#version 430 26e5c31af7Sopenharmony_cilayout(location = 0) out vec4 final_color; 27e5c31af7Sopenharmony_civoid main() { 28e5c31af7Sopenharmony_ci final_color = vec4(1.0, 0.0, 0.0, 1.0); 29e5c31af7Sopenharmony_ci} 30e5c31af7Sopenharmony_ciEND 31e5c31af7Sopenharmony_ci 32e5c31af7Sopenharmony_ciBUFFER position_buf DATA_TYPE vec3<float> DATA 33e5c31af7Sopenharmony_ci-1 1 0 34e5c31af7Sopenharmony_ci-1 -1 0 35e5c31af7Sopenharmony_ci 1 1 0 36e5c31af7Sopenharmony_ci 1 -1 0 37e5c31af7Sopenharmony_ci-1 -1 0 38e5c31af7Sopenharmony_ci 1 1 0 39e5c31af7Sopenharmony_ciEND 40e5c31af7Sopenharmony_ci 41e5c31af7Sopenharmony_ciBUFFER framebuffer FORMAT B8G8R8A8_UNORM 42e5c31af7Sopenharmony_ci 43e5c31af7Sopenharmony_ciPIPELINE graphics pipeline 44e5c31af7Sopenharmony_ci ATTACH vtex_shader 45e5c31af7Sopenharmony_ci ATTACH frag_shader 46e5c31af7Sopenharmony_ci 47e5c31af7Sopenharmony_ci VERTEX_DATA position_buf LOCATION 0 48e5c31af7Sopenharmony_ci FRAMEBUFFER_SIZE 250 250 49e5c31af7Sopenharmony_ci BIND BUFFER framebuffer AS color LOCATION 0 50e5c31af7Sopenharmony_ci 51e5c31af7Sopenharmony_ciEND 52e5c31af7Sopenharmony_ci 53e5c31af7Sopenharmony_ciRUN pipeline DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 6 54e5c31af7Sopenharmony_ciEXPECT framebuffer IDX 0 0 SIZE 250 250 EQ_RGBA 255 0 0 255 55