fbo-mrt-alphatest: Actually require MRTs to be available.
[piglit.git] / tests / spec / arb_shader_atomic_counters / common.h
blobde39877ca4eb130b4ce3ec585cbd731eae5432f1
1 /*
2 * Copyright © 2013 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
24 /** @file common.c
26 * Common utility functions for the ARB_shader_atomic_counters tests.
29 #ifndef __PIGLIT_ARB_SHADER_ATOMIC_COUNTERS_COMMON_H__
30 #define __PIGLIT_ARB_SHADER_ATOMIC_COUNTERS_COMMON_H__
32 #include "piglit-util-gl.h"
34 bool
35 atomic_counters_probe_buffer(unsigned base, unsigned count,
36 const uint32_t *expected);
38 bool
39 atomic_counters_compile(GLuint prog, GLuint stage, const char *src);
41 bool
42 atomic_counters_link(GLuint prog);
44 bool
45 atomic_counters_draw_point(GLuint prog, unsigned buf_size,
46 const uint32_t *buf);
48 bool
49 atomic_counters_draw_rect(GLuint prog, unsigned buf_size,
50 const uint32_t *buf);
52 bool
53 atomic_counters_draw_patch(GLuint prog, unsigned buf_size,
54 const uint32_t *buf);
56 bool
57 atomic_counters_supported(GLenum shader_stage);
59 struct atomic_counters_limits {
60 int fragment_counters;
61 int vertex_counters;
62 int combined_counters;
63 int fragment_buffers;
64 int vertex_buffers;
65 int combined_buffers;
66 int bindings;
67 int uniform_components;
70 struct atomic_counters_limits
71 atomic_counters_get_limits();
73 #define atomic_counters_subtest(status, shader_stage, name, func, ...) do { \
74 if (atomic_counters_supported(shader_stage)) { \
75 if (func(__VA_ARGS__)) { \
76 piglit_report_subtest_result(PIGLIT_PASS, name); \
77 } else { \
78 piglit_report_subtest_result(PIGLIT_FAIL, name); \
79 *status = PIGLIT_FAIL; \
80 } \
81 } else { \
82 piglit_report_subtest_result(PIGLIT_SKIP, name); \
83 } \
84 } while (0)
86 #endif