1 /* Copyright © 2012 Intel Corporation 2 * 3 * Permission is hereby granted, free of charge, to any person obtaining a 4 * copy of this software and associated documentation files (the "Software"), 5 * to deal in the Software without restriction, including without limitation 6 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 * and/or sell copies of the Software, and to permit persons to whom the 8 * Software is furnished to do so, subject to the following conditions: 9 * 10 * The above copyright notice and this permission notice (including the next 11 * paragraph) shall be included in all copies or substantial portions of the 12 * Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 * IN THE SOFTWARE. 21 */ 22 23 #include "common.h" 24 25 /** 26 * \file draw-buffers-common.h 27 * This file declares common functions which are used by multiple draw buffer 28 * test cases. 29 */ 30 31 /* Allocates all the relevant data arrays required in the test */ 32 void allocate_data_arrays(void); 33 34 /* Draws a test pattern without sample_alpha_to_coverage and 35 * sample_alpha_to_one 36 */ 37 void draw_reference_image(bool sample_alpha_to_coverage, 38 bool sample_alpha_to_one); 39 40 /* Draws the test pattern with either sample_alpha_to_coverage or 41 * sample_alpha_to_one enabled 42 */ 43 void draw_test_image(bool sample_alpha_to_coverage, 44 bool sample_alpha_to_one); 45 46 /* Frees the previously allocated data arrays */ 47 void free_data_arrays(void); 48 49 /* Initilaizes multisample framebuffer object with multiple draw buffers */ 50 void ms_fbo_and_draw_buffers_setup(int samples, 51 int width, int height, 52 int n_attachments, 53 GLenum test_buffers, 54 GLenum color_buffer_zero_format); 55 56 /* Probe downsampled FBO (resolve_fbo / resolve_int_fbo) to compare against 57 * expected color for each draw buffer. 58 */ 59 bool probe_framebuffer_color(void); 60 61 /* Probe downsampled FBO (resolve_fbo) to compare against expected depth values 62 * for each draw buffer. 63 */ 64 bool probe_framebuffer_depth(void); 65 66 void shader_compile(bool sample_alpha_to_coverage, 67 bool dual_src_blend, 68 bool frag_out_zero_write); 69