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
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
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"
35 atomic_counters_probe_buffer(unsigned base
, unsigned count
,
36 const uint32_t *expected
);
39 atomic_counters_compile(GLuint prog
, GLuint stage
, const char *src
);
42 atomic_counters_link(GLuint prog
);
45 atomic_counters_draw_point(GLuint prog
, unsigned buf_size
,
49 atomic_counters_draw_rect(GLuint prog
, unsigned buf_size
,
53 atomic_counters_draw_patch(GLuint prog
, unsigned buf_size
,
57 atomic_counters_supported(GLenum shader_stage
);
59 struct atomic_counters_limits
{
60 int fragment_counters
;
62 int combined_counters
;
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); \
78 piglit_report_subtest_result(PIGLIT_FAIL, name); \
79 *status = PIGLIT_FAIL; \
82 piglit_report_subtest_result(PIGLIT_SKIP, name); \