2 * Copyright © 2019 Advanced Micro Devices, Inc.
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
24 #include "piglit-util-gl.h"
26 PIGLIT_GL_TEST_CONFIG_BEGIN
28 config
.supports_gl_compat_version
= 12;
30 config
.window_visual
= PIGLIT_GL_VISUAL_RGBA
|
31 PIGLIT_GL_VISUAL_DOUBLE
;
32 config
.khr_no_error_support
= PIGLIT_HAS_ERRORS
;
34 PIGLIT_GL_TEST_CONFIG_END
37 piglit_init(int argc
, char **argv
)
39 piglit_require_extension("GL_EXT_direct_state_access");
44 init_texture(GLenum target
, int* image_size
, float** expected_pixels
)
48 const int height
= (target
== GL_TEXTURE_1D
) ? 1 : piglit_height
;
49 const int depth
= (target
== GL_TEXTURE_3D
) ? 2 : 1;
50 float* image
= piglit_rgbw_image(GL_RGBA
, piglit_width
, height
* depth
,
51 false, GL_UNSIGNED_NORMALIZED
);
52 *image_size
= piglit_width
* height
* depth
* 4 * sizeof(float);
54 glGenTextures(1, &tex
);
55 glTextureParameteriEXT(tex
, target
, GL_TEXTURE_WRAP_S
, GL_CLAMP_TO_EDGE
);
56 glTextureParameteriEXT(tex
, target
, GL_TEXTURE_WRAP_T
, GL_CLAMP_TO_EDGE
);
57 glTextureParameteriEXT(tex
, target
, GL_TEXTURE_WRAP_R
, GL_CLAMP_TO_EDGE
);
58 glTextureParameteriEXT(tex
, target
, GL_TEXTURE_MAG_FILTER
, GL_NEAREST
);
59 glTextureParameteriEXT(tex
, target
, GL_TEXTURE_MIN_FILTER
,GL_NEAREST
);
60 if (target
== GL_TEXTURE_1D
) {
61 glTextureImage1DEXT(tex
, target
, 0, GL_RGBA
,
63 GL_RGBA
, GL_FLOAT
, image
);
64 } else if (target
== GL_TEXTURE_2D
) {
65 glTextureImage2DEXT(tex
, target
, 0, GL_RGBA
,
66 piglit_width
, height
, 0,
67 GL_RGBA
, GL_FLOAT
, image
);
69 /* 2 layers 3D image */
70 glTextureImage3DEXT(tex
, target
, 0, GL_RGBA
,
71 piglit_width
, height
, depth
, 0,
72 GL_RGBA
, GL_FLOAT
, image
);
75 if (expected_pixels
!= NULL
) {
76 *expected_pixels
= image
;
85 dimension_to_target(int n
)
87 assert(n
== 1 || n
== 2 || n
== 3);
89 case 1: return GL_TEXTURE_1D
;
90 case 2: return GL_TEXTURE_2D
;
97 static GLenum use_display_list
= GL_NONE
;
100 static enum piglit_result
101 test_TextureImageNDEXT(void* data
)
104 const int n
= (int)(intptr_t) data
;
105 const GLenum target
= dimension_to_target(n
);
107 float* expected_pixels
, *got_pixels
;
110 if (use_display_list
!= GL_NONE
)
111 glNewList(list
, use_display_list
);
113 tex
= init_texture(target
, &image_size
, &expected_pixels
);
115 if (use_display_list
!= GL_NONE
)
118 if (use_display_list
== GL_COMPILE
) {
119 /* Texture shouldn't have been initialized yet */
120 pass
= !glIsTexture(tex
);
124 got_pixels
= (float*) malloc(image_size
);
125 glGetTextureImageEXT(tex
, target
, 0, GL_RGBA
, GL_FLOAT
, got_pixels
);
127 pass
= memcmp(expected_pixels
, got_pixels
, image_size
) == 0 && pass
;
129 /* The GL_EXT_direct_state_access spec says:
131 * INVALID_OPERATION is generated [...] if the target parameter does
132 * not match the target type of the texture object named by the texture
136 glTextureImage2DEXT(tex
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, 0, GL_RGBA
,
137 piglit_width
, piglit_height
, 0,
138 GL_RGBA
, GL_FLOAT
, got_pixels
);
139 pass
= piglit_check_gl_error(GL_INVALID_OPERATION
) && pass
;
142 free(expected_pixels
);
145 glDeleteTextures(1, &tex
);
147 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
150 static enum piglit_result
151 test_TextureSubImageNDEXT(void* data
)
155 const int n
= (int)(intptr_t) data
;
156 const GLenum target
= dimension_to_target(n
);
158 float* original_pixels
, *modified_pixels
, *got_pixels
;
159 GLuint tex
= init_texture(target
, &image_size
, &original_pixels
);
160 int len
= image_size
/ sizeof(float);
162 if (use_display_list
!= GL_NONE
)
163 glNewList(list
, use_display_list
);
165 /* Replace the whole texture using glTextureSubImageNDEXT, line by line */
166 modified_pixels
= (float*) malloc(image_size
);
167 for (i
= 0; i
< len
; i
++) {
168 modified_pixels
[i
] = original_pixels
[(i
+ 1) % len
];
172 glTextureSubImage1DEXT(tex
, target
, 0,
177 for (i
= 0; i
< piglit_height
; i
++) {
179 glTextureSubImage2DEXT(tex
,
181 0, i
, piglit_width
, 1,
183 &modified_pixels
[piglit_width
* 4 * i
]);
185 /* Update the 1st layer of the 3D image */
186 glTextureSubImage3DEXT(tex
,
188 0, i
, 0, piglit_width
, 1, 1,
190 &modified_pixels
[piglit_width
* 4 * i
]);
191 /* And the 2nd layer */
192 glTextureSubImage3DEXT(tex
,
194 0, i
, 1, piglit_width
, 1, 1,
196 &modified_pixels
[piglit_width
* 4 * (i
+ piglit_height
)]);
201 if (use_display_list
!= GL_NONE
)
204 got_pixels
= (float*) malloc(image_size
);
205 glGetTextureImageEXT(tex
, target
, 0, GL_RGBA
, GL_FLOAT
, got_pixels
);
207 if (use_display_list
== GL_COMPILE
) {
208 /* Texture shouldn't have been modified yet */
209 pass
= memcmp(original_pixels
, got_pixels
, image_size
) == 0 && pass
;
212 glGetTextureImageEXT(tex
, target
, 0, GL_RGBA
, GL_FLOAT
, got_pixels
);
215 pass
= memcmp(modified_pixels
, got_pixels
, image_size
) == 0 && pass
;
217 /* Verify error added by the extension:
218 "INVALID_OPERATION is generated [...] if the target parameter does
219 not match the target type of the texture object named by the texture
223 glTextureSubImage2DEXT(tex
,
224 GL_TEXTURE_CUBE_MAP_POSITIVE_X
, 0,
228 pass
= piglit_check_gl_error(GL_INVALID_OPERATION
) && pass
;
231 glDeleteTextures(1, &tex
);
232 free(modified_pixels
);
233 free(original_pixels
);
235 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
238 static enum piglit_result
239 test_CopyTextureImageNDEXT(void* data
)
242 const int n
= (int)(intptr_t) data
;
243 assert(n
== 1 || n
== 2);
244 const GLenum target
= dimension_to_target(n
);
246 float* original_pixels
;
247 GLuint tex
= init_texture(target
, &image_size
, &original_pixels
);
248 const int height
= (target
== GL_TEXTURE_1D
) ? 1 : piglit_height
;
251 glClearColor(0.25, 0.5, 0.75, 1);
252 glClear(GL_COLOR_BUFFER_BIT
);
254 if (use_display_list
!= GL_NONE
)
255 glNewList(list
, use_display_list
);
259 glCopyTextureImage1DEXT(tex
, target
, 0, GL_RGBA
, 0, 0, piglit_width
, 0);
262 glCopyTextureImage2DEXT(tex
, target
, 0, GL_RGBA
, 0, 0, piglit_width
, piglit_height
, 0);
266 if (use_display_list
!= GL_NONE
)
269 got_pixels
= (float*) malloc(piglit_width
* height
* 4 * sizeof(float));
271 /* Compare glGetTextureImageEXT and on screen pixels */
272 glGetTextureImageEXT(tex
, target
, 0, GL_RGBA
, GL_FLOAT
, got_pixels
);
274 if (use_display_list
== GL_COMPILE
) {
275 /* Texture shouldn't have been modified yet */
276 pass
= memcmp(got_pixels
, original_pixels
, image_size
) == 0;
278 glGetTextureImageEXT(tex
, target
, 0, GL_RGBA
, GL_FLOAT
, got_pixels
);
281 pass
= piglit_probe_rect_rgba(0, 0, piglit_width
, height
, got_pixels
) && pass
;
284 free(original_pixels
);
286 glDeleteTextures(1, &tex
);
288 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
291 static enum piglit_result
292 test_CopyTextureSubImageNDEXT(void* data
)
295 const int n
= (int)(intptr_t) data
;
296 const GLenum target
= dimension_to_target(n
);
298 float* original_pixels
;
299 GLuint tex
= init_texture(target
, &image_size
, &original_pixels
);
300 const int height
= (target
== GL_TEXTURE_1D
) ? 1 : piglit_height
;
303 glClearColor(0.25, 0.5, 0.75, 1);
304 glClear(GL_COLOR_BUFFER_BIT
);
306 if (use_display_list
!= GL_NONE
)
307 glNewList(list
, use_display_list
);
311 glCopyTextureSubImage1DEXT(tex
, target
, 0, 0, 0, 0, piglit_width
);
314 glCopyTextureSubImage2DEXT(tex
, target
, 0, 0, 0, 0, 0, piglit_width
, piglit_height
);
317 glCopyTextureSubImage3DEXT(tex
, target
, 0, 0, 0, 0, 0, 0, piglit_width
, piglit_height
);
321 if (use_display_list
!= GL_NONE
)
324 got_pixels
= (float*) malloc(image_size
);
326 /* Compare glGetTextureImageEXT and on screen pixels */
327 glGetTextureImageEXT(tex
, target
, 0, GL_RGBA
, GL_FLOAT
, got_pixels
);
329 if (use_display_list
== GL_COMPILE
) {
330 /* Texture shouldn't have been modified yet */
331 pass
= memcmp(got_pixels
, original_pixels
, image_size
) == 0;
333 glGetTextureImageEXT(tex
, target
, 0, GL_RGBA
, GL_FLOAT
, got_pixels
);
336 pass
= piglit_probe_rect_rgba(0, 0, piglit_width
, height
, got_pixels
) && pass
;
339 free(original_pixels
);
341 glDeleteTextures(1, &tex
);
343 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
346 static enum piglit_result
347 test_TextureParameterEXT(void* data
)
350 static const GLenum targets
[] = {
351 GL_TEXTURE_1D
, GL_TEXTURE_2D
, GL_TEXTURE_3D
,
357 void (*textureParameteri_variant
) (GLuint
, GLenum
, GLenum
, GLint
*) = data
;
368 GL_CLAMP
, GL_CLAMP_TO_EDGE
, GL_REPEAT
,
369 GL_CLAMP_TO_BORDER
, GL_MIRRORED_REPEAT
376 GL_CLAMP
, GL_CLAMP_TO_EDGE
, GL_REPEAT
,
377 GL_CLAMP_TO_BORDER
, GL_MIRRORED_REPEAT
384 GL_CLAMP
, GL_CLAMP_TO_EDGE
, GL_REPEAT
,
385 GL_CLAMP_TO_BORDER
, GL_MIRRORED_REPEAT
389 GL_TEXTURE_MIN_FILTER
,
392 GL_NEAREST
, GL_LINEAR
,
393 GL_NEAREST_MIPMAP_LINEAR
, GL_NEAREST_MIPMAP_NEAREST
,
394 GL_LINEAR_MIPMAP_LINEAR
, GL_LINEAR_MIPMAP_NEAREST
398 GL_TEXTURE_MAG_FILTER
,
401 GL_NEAREST
, GL_LINEAR
405 GL_TEXTURE_BASE_LEVEL
,
409 GL_TEXTURE_MAX_LEVEL
,
413 GL_DEPTH_TEXTURE_MODE
,
416 GL_RED
, GL_LUMINANCE
, GL_INTENSITY
, GL_ALPHA
420 GL_TEXTURE_COMPARE_MODE
,
423 GL_NONE
, GL_COMPARE_REF_TO_TEXTURE
427 GL_TEXTURE_COMPARE_FUNC
,
430 GL_LEQUAL
, GL_GEQUAL
, GL_LESS
, GL_GREATER
,
431 GL_EQUAL
, GL_NOTEQUAL
, GL_ALWAYS
, GL_NEVER
443 if (!textureParameteri_variant
) {
447 for (i
= 0; i
< ARRAY_SIZE(targets
); i
++) {
448 GLenum target
= targets
[i
];
450 glGenTextures(ARRAY_SIZE(tex
), tex
);
452 for (j
= 0; j
< ARRAY_SIZE(tested
); j
++) {
453 for (k
= 0; k
< tested
[j
].value_count
; k
++) {
454 if (tested
[j
].values
[k
] == GL_RED
&& !piglit_is_extension_supported("GL_ARB_texture_rg"))
458 if (use_display_list
!= GL_NONE
)
459 glNewList(list
, use_display_list
);
461 glGetTextureParameterivEXT(tex
[1], target
,
462 tested
[j
].pname
, &original_value
);
464 (*textureParameteri_variant
)(
467 &tested
[j
].values
[k
]);
469 if (use_display_list
!= GL_NONE
)
472 if (use_display_list
== GL_COMPILE
) {
474 glGetTextureParameterivEXT(tex
[1], target
,
475 tested
[j
].pname
, &v
);
476 pass
= (v
== original_value
) && pass
;
480 glGetTextureParameterivEXT(tex
[1], target
, tested
[j
].pname
, &value
);
482 if (value
!= tested
[j
].values
[k
]) {
483 piglit_loge("TextureParameter*EXT(%s, %s, ...) failed. Expected %d but got %d\n",
484 piglit_get_gl_enum_name(target
),
485 piglit_get_gl_enum_name(tested
[j
].pname
),
490 if (!piglit_check_gl_error(GL_NO_ERROR
)) {
491 piglit_loge("TextureParameter*EXT(%s, %s, ...) failed.\n",
492 piglit_get_gl_enum_name(target
),
493 piglit_get_gl_enum_name(tested
[j
].pname
));
498 glDeleteTextures(ARRAY_SIZE(tex
), tex
);
500 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
503 static enum piglit_result
504 test_TextureParameterfEXT(void* data
)
507 static const GLenum targets
[] = {
508 GL_TEXTURE_1D
, GL_TEXTURE_2D
, GL_TEXTURE_3D
,
509 GL_TEXTURE_1D_ARRAY
, GL_TEXTURE_2D_ARRAY
,
516 const struct pname_value
{
523 1, { (float) rand() / RAND_MAX
}
539 for (i
= 0; i
< ARRAY_SIZE(targets
); i
++) {
540 GLenum target
= targets
[i
];
542 if ((target
== GL_TEXTURE_1D_ARRAY
|| target
== GL_TEXTURE_2D_ARRAY
) &&
543 !piglit_is_extension_supported("GL_EXT_texture_array")) {
547 glGenTextures(ARRAY_SIZE(tex
), tex
);
549 for (j
= 0; j
< ARRAY_SIZE(tested
); j
++) {
550 for (k
= 0; k
< tested
[j
].value_count
; k
++) {
551 float original_values
[2];
553 if (use_display_list
!= GL_NONE
)
554 glNewList(list
, use_display_list
);
556 for (l
= 0; l
< 2; l
++) {
557 glGetTextureParameterfvEXT(tex
[l
], target
,
558 tested
[j
].pname
, &original_values
[l
]);
561 glTextureParameterfEXT(
564 tested
[j
].values
[k
]);
566 glTextureParameterfvEXT(
569 &tested
[j
].values
[k
]);
571 if (use_display_list
!= GL_NONE
)
574 if (use_display_list
== GL_COMPILE
) {
575 for (l
= 0; l
< 2; l
++) {
577 glGetTextureParameterfvEXT(tex
[l
], target
,
578 tested
[j
].pname
, &v
);
579 pass
= v
== original_values
[l
] && pass
;
584 for (l
= 0; l
< 2; l
++) {
585 glGetTextureParameterfvEXT(tex
[l
], target
, tested
[j
].pname
, &value
);
587 if (value
!= tested
[j
].values
[k
]) {
588 piglit_loge("%s(%s, %s, ...) failed. Expected %f but got %f\n",
589 l
== 0 ? "glTextureParameterfEXT" : "glTextureParameterfvEXT",
590 piglit_get_gl_enum_name(target
),
591 piglit_get_gl_enum_name(tested
[j
].pname
),
596 if (!piglit_check_gl_error(GL_NO_ERROR
)) {
597 piglit_loge("%s(%s, %s, ...) failed.\n",
598 l
== 0 ? "glTextureParameterfEXT" : "glTextureParameterfvEXT",
599 piglit_get_gl_enum_name(target
),
600 piglit_get_gl_enum_name(tested
[j
].pname
));
606 glDeleteTextures(ARRAY_SIZE(tex
), tex
);
608 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
612 test_EnableDisableEXT(void* data
)
614 /* The GL_EXT_direct_state_access spec says:
616 * The following commands (introduced by EXT_draw_buffers2):
618 * void EnableIndexedEXT(enum cap, uint index);
619 * void DisableIndexedEXT(enum cap, uint index);
621 * are equivalent (assuming no errors) to the following:
623 * ActiveTexture(TEXTURE0+index);
626 * [...] when the cap parameter is one of the texture-related
627 * enable token depending on the active texture state, namely
628 * TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP,
629 * TEXTURE_RECTANGLE_ARB, TEXTURE_GEN_S, TEXTURE_GEN_T,
630 * TEXTURE_GEN_R, or TEXTURE_GEN_Q.
632 static const GLenum caps
[] = {
633 GL_TEXTURE_1D
, GL_TEXTURE_2D
, GL_TEXTURE_3D
, GL_TEXTURE_CUBE_MAP
,
634 GL_TEXTURE_GEN_S
, GL_TEXTURE_GEN_T
, GL_TEXTURE_GEN_R
,
638 int i
, max_texture_units
;
639 glGetIntegerv(GL_MAX_TEXTURE_UNITS
, &max_texture_units
);
641 for (i
= 0; i
< ARRAY_SIZE(caps
); i
++) {
642 const GLenum cap
= caps
[i
];
644 const int index
= rand() % max_texture_units
;
645 const bool value
= rand() % 2;
649 glActiveTexture(GL_TEXTURE0
+ (index
+ 1) % max_texture_units
);
651 if (use_display_list
!= GL_NONE
)
652 glNewList(list
, use_display_list
);
655 glEnableIndexedEXT(cap
, index
);
657 glDisableIndexedEXT(cap
, index
);
660 if (use_display_list
!= GL_NONE
)
663 if (use_display_list
== GL_COMPILE
)
666 /* Read back with glIsEnabledIndexedEXT */
667 if (value
!= glIsEnabledIndexedEXT(cap
, index
)) {
668 piglit_loge("gl%sIndexedEXT(%s, %d) / glIsEnabledIndexedEXT failed.\n",
669 value
? "Enable" : "Disable",
670 piglit_get_gl_enum_name(cap
),
675 /* Read back with glGetBooleanIndexedvEXT */
676 glGetBooleanIndexedvEXT(cap
, index
, &got
);
678 piglit_loge("gl%sIndexedEXT(%s, %d) / glGetBooleanIndexedvEXT failed.\n",
679 value
? "Enable" : "Disable",
680 piglit_get_gl_enum_name(cap
),
685 /* Read back with glGetBooleanIndexedvEXT */
686 glGetIntegerIndexedvEXT(cap
, index
, &got_i
);
687 if (value
!= got_i
) {
688 piglit_loge("gl%sIndexedEXT(%s, %d) / glGetIntegerIndexedvEXT failed.\n",
689 value
? "Enable" : "Disable",
690 piglit_get_gl_enum_name(cap
),
699 static enum piglit_result
700 test_TextureProxyTarget(void* data
)
705 const int n
= (int)(intptr_t) data
;
706 const GLenum target
= dimension_to_target(n
);
708 GLenum proxy_target
= (target
== GL_TEXTURE_1D
) ? GL_PROXY_TEXTURE_1D
:
709 (target
== GL_TEXTURE_2D
? GL_PROXY_TEXTURE_2D
: GL_PROXY_TEXTURE_3D
);
712 glGenTextures(1, &tex
);
714 /* The GL_EXT_direct_state_access says:
716 * Proxy targets work with the glTex* (glTexImage*)
717 * and glGetTex* (glGetTexLevelParameter*) commands that support
718 * proxy textures BUT the texture name must be 0 to avoid a
719 * GL_INVALID_OPERATION error.
722 glTextureImage1DEXT(tex
, proxy_target
, 0, GL_RGBA
,
724 GL_RGBA
, GL_FLOAT
, NULL
);
726 glTextureImage2DEXT(tex
, proxy_target
, 0, GL_RGBA
,
727 piglit_width
, piglit_height
, 0,
728 GL_RGBA
, GL_FLOAT
, NULL
);
730 glTextureImage3DEXT(tex
, proxy_target
, 0, GL_RGBA
,
731 piglit_width
, piglit_height
, 1, 0,
732 GL_RGBA
, GL_FLOAT
, NULL
);
734 pass
= piglit_check_gl_error(GL_INVALID_OPERATION
) && pass
;
737 glTextureImage1DEXT(0, proxy_target
, 0, GL_RGBA
,
739 GL_RGBA
, GL_FLOAT
, NULL
);
741 glTextureImage2DEXT(0, proxy_target
, 0, GL_RGBA
,
742 piglit_width
, piglit_height
, 0,
743 GL_RGBA
, GL_FLOAT
, NULL
);
745 glTextureImage3DEXT(0, proxy_target
, 0, GL_RGBA
,
746 piglit_width
, piglit_height
, 1, 0,
747 GL_RGBA
, GL_FLOAT
, NULL
);
749 glGetTextureLevelParameterivEXT(0, proxy_target
, 0,
750 GL_TEXTURE_WIDTH
, &width
);
751 glGetTextureLevelParameterfvEXT(0, proxy_target
, 0,
752 GL_TEXTURE_HEIGHT
, &height
);
753 pass
= width
== piglit_width
&& pass
;
754 pass
= (int)height
== (n
> 1 ? piglit_height
: 1) && pass
;
756 glDeleteTextures(1, &tex
);
758 return pass
&& piglit_check_gl_error(GL_NO_ERROR
) ? PIGLIT_PASS
: PIGLIT_FAIL
;
761 void TextureParameteriEXT_wrapper(GLuint texture
, GLenum target
, GLenum pname
, GLint
* value
) {
762 glTextureParameteriEXT(texture
, target
, pname
, *value
);
765 void TextureParameterIuivEXT_wrapper(GLuint texture
, GLenum target
, GLenum pname
, GLint
* value
) {
766 glTextureParameterIuivEXT(texture
, target
, pname
, (GLuint
*) value
);
773 const bool have_ext_tex_int
= piglit_is_extension_supported("GL_EXT_texture_integer");
774 struct piglit_subtest tests
[] = {
776 "TextureParameteriEXT",
778 test_TextureParameterEXT
,
779 TextureParameteriEXT_wrapper
782 "TextureParameterivEXT",
784 test_TextureParameterEXT
,
785 glTextureParameterivEXT
788 "TextureParameterIivEXT",
790 test_TextureParameterEXT
,
791 have_ext_tex_int
? glTextureParameterIivEXT
: NULL
794 "TextureParameterIuivEXT",
796 test_TextureParameterEXT
,
797 have_ext_tex_int
? TextureParameterIuivEXT_wrapper
: NULL
800 "TextureParameterfEXT",
802 test_TextureParameterfEXT
,
808 test_TextureImageNDEXT
,
814 test_TextureImageNDEXT
,
820 test_TextureImageNDEXT
,
824 "TextureSubImage1DEXT",
826 test_TextureSubImageNDEXT
,
830 "TextureSubImage2DEXT",
832 test_TextureSubImageNDEXT
,
836 "TextureSubImage3DEXT",
838 test_TextureSubImageNDEXT
,
842 "CopyTextureImage1DEXT",
844 test_CopyTextureImageNDEXT
,
848 "CopyTextureImage2DEXT",
850 test_CopyTextureImageNDEXT
,
854 "CopyTextureSubImage1DEXT",
856 test_CopyTextureSubImageNDEXT
,
860 "CopyTextureSubImage2DEXT",
862 test_CopyTextureSubImageNDEXT
,
866 "CopyTextureSubImage3DEXT",
868 test_CopyTextureSubImageNDEXT
,
874 test_EnableDisableEXT
877 "GL_PROXY_TEXTURE_1D + glTex*",
879 test_TextureProxyTarget
,
883 "GL_PROXY_TEXTURE_2D + glTex*",
885 test_TextureProxyTarget
,
889 "GL_PROXY_TEXTURE_3D + glTex*",
891 test_TextureProxyTarget
,
899 enum piglit_result result
= piglit_run_selected_subtests(tests
, NULL
, 0, PIGLIT_PASS
);
900 list
= glGenLists(1);
902 /* Re-run the same test but using display list GL_COMPILE */
903 for (i
= 0; tests
[i
].name
; i
++) {
904 char* test_name_display_list
;
905 asprintf(&test_name_display_list
, "%s + display list GL_COMPILE", tests
[i
].name
);
906 tests
[i
].name
= test_name_display_list
;
908 use_display_list
= GL_COMPILE
;
909 result
= piglit_run_selected_subtests(tests
, NULL
, 0, result
);
911 /* Re-run the same test but using display list GL_COMPILE_AND_EXECUTE */
912 for (i
= 0; tests
[i
].name
; i
++) {
913 char* test_name_display_list
;
914 asprintf(&test_name_display_list
, "%s_AND_EXECUTE", tests
[i
].name
);
915 tests
[i
].name
= test_name_display_list
;
917 use_display_list
= GL_COMPILE_AND_EXECUTE
;
918 result
= piglit_run_selected_subtests(tests
, NULL
, 0, result
);
920 glDeleteLists(list
, 1);