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 free(expected_pixels
);
132 /* The GL_EXT_direct_state_access spec says:
134 * INVALID_OPERATION is generated [...] if the target parameter does
135 * not match the target type of the texture object named by the texture
139 glTextureImage2DEXT(tex
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, 0, GL_RGBA
,
140 piglit_width
, piglit_height
, 0,
141 GL_RGBA
, GL_FLOAT
, got_pixels
);
142 pass
= piglit_check_gl_error(GL_INVALID_OPERATION
) && pass
;
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_TextureParameteriEXT(void* data
)
350 static const GLenum targets
[] = {
351 GL_TEXTURE_1D
, GL_TEXTURE_2D
, GL_TEXTURE_3D
,
354 int i
, j
, k
, l
, value
;
357 const struct pname_value
{
366 GL_CLAMP
, GL_CLAMP_TO_EDGE
, GL_REPEAT
,
367 GL_CLAMP_TO_BORDER
, GL_MIRRORED_REPEAT
374 GL_CLAMP
, GL_CLAMP_TO_EDGE
, GL_REPEAT
,
375 GL_CLAMP_TO_BORDER
, GL_MIRRORED_REPEAT
382 GL_CLAMP
, GL_CLAMP_TO_EDGE
, GL_REPEAT
,
383 GL_CLAMP_TO_BORDER
, GL_MIRRORED_REPEAT
387 GL_TEXTURE_MIN_FILTER
,
390 GL_NEAREST
, GL_LINEAR
,
391 GL_NEAREST_MIPMAP_LINEAR
, GL_NEAREST_MIPMAP_NEAREST
,
392 GL_LINEAR_MIPMAP_LINEAR
, GL_LINEAR_MIPMAP_NEAREST
396 GL_TEXTURE_MAG_FILTER
,
399 GL_NEAREST
, GL_LINEAR
403 GL_TEXTURE_BASE_LEVEL
,
407 GL_TEXTURE_MAX_LEVEL
,
411 GL_DEPTH_TEXTURE_MODE
,
414 GL_RED
, GL_LUMINANCE
, GL_INTENSITY
, GL_ALPHA
418 GL_TEXTURE_COMPARE_MODE
,
421 GL_NONE
, GL_COMPARE_REF_TO_TEXTURE
425 GL_TEXTURE_COMPARE_FUNC
,
428 GL_LEQUAL
, GL_GEQUAL
, GL_LESS
, GL_GREATER
,
429 GL_EQUAL
, GL_NOTEQUAL
, GL_ALWAYS
, GL_NEVER
442 for (i
= 0; i
< ARRAY_SIZE(targets
); i
++) {
443 GLenum target
= targets
[i
];
445 glGenTextures(ARRAY_SIZE(tex
), tex
);
447 for (j
= 0; j
< ARRAY_SIZE(tested
); j
++) {
448 for (k
= 0; k
< tested
[j
].value_count
; k
++) {
449 int original_values
[2];
450 if (use_display_list
!= GL_NONE
)
451 glNewList(list
, use_display_list
);
453 for (l
= 0; l
< 2; l
++) {
454 glGetTextureParameterivEXT(tex
[l
], target
,
455 tested
[j
].pname
, &original_values
[l
]);
458 glTextureParameteriEXT(
461 tested
[j
].values
[k
]);
463 glTextureParameterivEXT(
466 &tested
[j
].values
[k
]);
468 if (use_display_list
!= GL_NONE
)
471 if (use_display_list
== GL_COMPILE
) {
472 for (l
= 0; l
< 2; l
++) {
474 glGetTextureParameterivEXT(tex
[l
], target
,
475 tested
[j
].pname
, &v
);
476 pass
= v
== original_values
[l
] && pass
;
481 for (l
= 0; l
< 2; l
++) {
482 glGetTextureParameterivEXT(tex
[l
], target
, tested
[j
].pname
, &value
);
484 if (value
!= tested
[j
].values
[k
]) {
485 piglit_loge("%s(%s, %s, ...) failed. Expected %d but got %d\n",
486 l
== 0 ? "glTextureParameteriEXT" : "glTextureParameterivEXT",
487 piglit_get_gl_enum_name(target
),
488 piglit_get_gl_enum_name(tested
[j
].pname
),
493 if (!piglit_check_gl_error(GL_NO_ERROR
)) {
494 piglit_loge("%s(%s, %s, ...) failed.\n",
495 l
== 0 ? "glTextureParameteriEXT" : "glTextureParameterivEXT",
496 piglit_get_gl_enum_name(target
),
497 piglit_get_gl_enum_name(tested
[j
].pname
));
503 glDeleteTextures(ARRAY_SIZE(tex
), tex
);
505 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
508 static enum piglit_result
509 test_TextureParameterfEXT(void* data
)
512 static const GLenum targets
[] = {
513 GL_TEXTURE_1D
, GL_TEXTURE_2D
, GL_TEXTURE_3D
,
514 GL_TEXTURE_1D_ARRAY
, GL_TEXTURE_2D_ARRAY
,
521 const struct pname_value
{
528 1, { (float) rand() / RAND_MAX
}
544 for (i
= 0; i
< ARRAY_SIZE(targets
); i
++) {
545 GLenum target
= targets
[i
];
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
;
766 struct piglit_subtest tests
[] = {
768 "TextureParameteriEXT",
770 test_TextureParameteriEXT
,
774 "TextureParameterfEXT",
776 test_TextureParameterfEXT
,
782 test_TextureImageNDEXT
,
788 test_TextureImageNDEXT
,
794 test_TextureImageNDEXT
,
798 "TextureSubImage1DEXT",
800 test_TextureSubImageNDEXT
,
804 "TextureSubImage2DEXT",
806 test_TextureSubImageNDEXT
,
810 "TextureSubImage3DEXT",
812 test_TextureSubImageNDEXT
,
816 "CopyTextureImage1DEXT",
818 test_CopyTextureImageNDEXT
,
822 "CopyTextureImage2DEXT",
824 test_CopyTextureImageNDEXT
,
828 "CopyTextureSubImage1DEXT",
830 test_CopyTextureSubImageNDEXT
,
834 "CopyTextureSubImage2DEXT",
836 test_CopyTextureSubImageNDEXT
,
840 "CopyTextureSubImage3DEXT",
842 test_CopyTextureSubImageNDEXT
,
848 test_EnableDisableEXT
851 "GL_PROXY_TEXTURE_1D + glTex*",
853 test_TextureProxyTarget
,
857 "GL_PROXY_TEXTURE_2D + glTex*",
859 test_TextureProxyTarget
,
863 "GL_PROXY_TEXTURE_3D + glTex*",
865 test_TextureProxyTarget
,
873 enum piglit_result result
= piglit_run_selected_subtests(tests
, NULL
, 0, PIGLIT_PASS
);
874 list
= glGenLists(1);
876 /* Re-run the same test but using display list GL_COMPILE */
877 for (i
= 0; tests
[i
].name
; i
++) {
878 char* test_name_display_list
;
879 asprintf(&test_name_display_list
, "%s + display list GL_COMPILE", tests
[i
].name
);
880 tests
[i
].name
= test_name_display_list
;
882 use_display_list
= GL_COMPILE
;
883 result
= piglit_run_selected_subtests(tests
, NULL
, 0, result
);
885 /* Re-run the same test but using display list GL_COMPILE_AND_EXECUTE */
886 for (i
= 0; tests
[i
].name
; i
++) {
887 char* test_name_display_list
;
888 asprintf(&test_name_display_list
, "%s_AND_EXECUTE", tests
[i
].name
);
889 tests
[i
].name
= test_name_display_list
;
891 use_display_list
= GL_COMPILE_AND_EXECUTE
;
892 result
= piglit_run_selected_subtests(tests
, NULL
, 0, result
);
894 glDeleteLists(list
, 1);