[3/3] arb_get_texture_sub_image: update cube map tests to complete the cube map

Submitted by Anthony Pesch on March 28, 2018, 2:33 p.m.

Details

Message ID 20180328143359.16538-3-inolen@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Anthony Pesch March 28, 2018, 2:33 p.m.
From: Anthony Pesch <apesch@nvidia.com>

Update cube map tests to complete the cube map before performing the final
query. This final query is expected to succeed, however, querying a cube map
which is not cube complete should set INVALID_OPERATION as per the OpenGL 4.6
Core spec:

"An INVALID_OPERATION error is generated if the effective target is
TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY, and the texture object
is not cube complete or cube array complete, respectively."
---
 tests/spec/arb_get_texture_sub_image/errors.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_get_texture_sub_image/errors.c b/tests/spec/arb_get_texture_sub_image/errors.c
index 1e7b17115..4b99d1cc2 100644
--- a/tests/spec/arb_get_texture_sub_image/errors.c
+++ b/tests/spec/arb_get_texture_sub_image/errors.c
@@ -253,16 +253,20 @@  test_cubemap_faces(void)
                         0, GL_RGBA, 8, 8, 0, GL_RGBA, GL_FLOAT, NULL);
         }
 
-        /* try to get all six cube faces, should fail */
+        /* try to query incomplete cube map, should fail */
         glGetTextureSubImage(tex, 0,
                              0, 0, 0,
-                             8, 8, 6,
+                             8, 8, 5,
                              GL_RGBA, GL_UNSIGNED_BYTE,
                              sizeof(results), results);
 	if (!piglit_check_gl_error(GL_INVALID_OPERATION))
 		pass = false;
 
-        /* try to get five cube faces, should pass */
+	/* upload final face */
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + 5,
+	             0, GL_RGBA, 8, 8, 0, GL_RGBA, GL_FLOAT, NULL);
+
+        /* try to query complete cube map, should now pass */
         glGetTextureSubImage(tex, 0,
                              0, 0, 0,
                              8, 8, 5,