From 4af045295a0279347018687711cb32892084d89c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 12 Sep 2016 12:37:08 -0700 Subject: [PATCH] Fix internal format/type for 3D + depth/stencil negative API tests. According to the ES 3.2 specification: "Textures with a base internal format of DEPTH_COMPONENT, DEPTH_STENCIL or STENCIL_INDEX are supported by texture image specification commands only if target is TEXTURE_2D, TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_ARRAY, TEXTURE_2D_MULTISAMPLE_ARRAY, TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY. Using these formats in conjunction with any other target will result in an INVALID_OPERATION error." This subtest tried to check the above error condition, but it specified GL_DEPTH_STENCIL / GL_DEPTH_COMPONENT as format, rather than internalFormat. Since the above text calls out "base internal format", we should specify it as internalFormat. We also change GL_DEPTH_STENCIL to use GL_UNSIGNED_INT_24_8 rather than GL_UNSIGNED_BYTE, as that combination was illegal for a different reason than the one the test intended to check. Change-Id: I44bf607533b59f93fa42415bd6cad8783352582d (cherry picked from commit ae7f8e0a07730e693b24d3dc7a23d2372319145e) (cherry picked from commit d2f3b468db45e8deb130de84bf194eebe37d5fff) --- modules/gles31/functional/es31fNegativeTextureApiTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gles31/functional/es31fNegativeTextureApiTests.cpp b/modules/gles31/functional/es31fNegativeTextureApiTests.cpp index 9cad1a8..6038b40 100644 --- a/modules/gles31/functional/es31fNegativeTextureApiTests.cpp +++ b/modules/gles31/functional/es31fNegativeTextureApiTests.cpp @@ -2674,9 +2674,9 @@ void teximage3d (NegativeTestContext& ctx) ctx.endSection(); ctx.beginSection("GL_INVALID_OPERATION is generated if target is GL_TEXTURE_3D and format is GL_DEPTH_COMPONENT, or GL_DEPTH_STENCIL."); - ctx.glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, 1, 1, 1, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_BYTE, 0); + ctx.glTexImage3D(GL_TEXTURE_3D, 0, GL_DEPTH_STENCIL, 1, 1, 1, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0); ctx.expectError(GL_INVALID_OPERATION); - ctx.glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, 1, 1, 1, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, 0); + ctx.glTexImage3D(GL_TEXTURE_3D, 0, GL_DEPTH_COMPONENT, 1, 1, 1, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, 0); ctx.expectError(GL_INVALID_OPERATION); ctx.endSection(); -- 2.7.4