diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index 2c950ff8..19878b9c 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -3793,23 +3793,43 @@ namespace MobileGL::MG_Impl::GLImpl { GetTextureImage(texture, level, format, type, bufSize, pixels); } + // A buffer texture carries none of the sampler or level state these queries report. Reached by + // name there is no target token to blame, so the wrong object is INVALID_OPERATION rather than + // the INVALID_ENUM the target forms report for an unaccepted target (GL 4.6 core 8.11). + static Bool ValidateNamedTextureHasParameters(const SharedPtr& textureObject, + const char* caller) { + if (!textureObject) return false; + if (textureObject->GetStorageType() == TextureStorageType::Buffer) { + MG_State::pGLContext->RecordError( + ErrorCode::InvalidOperation, + MakeUnique("MG_Impl/GLImpl", caller, + "The effective target of `texture` has no texture parameters.")); + return false; + } + return true; + } + void GetTextureParameteriv(GLuint texture, GLenum pname, GLint* params) { auto textureObject = GetTextureObjectByName(texture, __func__); + if (!ValidateNamedTextureHasParameters(textureObject, __func__)) return; WithTemporarilyBoundNamedTexture(textureObject, [&](GLenum target) { GetTexParameteriv_State(target, pname, params); }); } void GetTextureParameterfv(GLuint texture, GLenum pname, GLfloat* params) { auto textureObject = GetTextureObjectByName(texture, __func__); + if (!ValidateNamedTextureHasParameters(textureObject, __func__)) return; WithTemporarilyBoundNamedTexture(textureObject, [&](GLenum target) { GetTexParameterfv_State(target, pname, params); }); } void GetTextureParameterIiv(GLuint texture, GLenum pname, GLint* params) { auto textureObject = GetTextureObjectByName(texture, __func__); + if (!ValidateNamedTextureHasParameters(textureObject, __func__)) return; WithTemporarilyBoundNamedTexture(textureObject, [&](GLenum target) { GetTexParameterIiv_State(target, pname, params); }); } void GetTextureParameterIuiv(GLuint texture, GLenum pname, GLuint* params) { auto textureObject = GetTextureObjectByName(texture, __func__); + if (!ValidateNamedTextureHasParameters(textureObject, __func__)) return; WithTemporarilyBoundNamedTexture(textureObject, [&](GLenum target) { GetTexParameterIuiv_State(target, pname, params); }); } diff --git a/tools/cts/README.md b/tools/cts/README.md index acce48aa..67cd586d 100644 --- a/tools/cts/README.md +++ b/tools/cts/README.md @@ -77,8 +77,8 @@ mustpass list, lavapipe / Mesa 25.2.8, `--deqp-surface-type=fbo`. | backend | conformance | strict Pass | Fail | InternalError | Crash | | --- | ---: | ---: | ---: | ---: | ---: | -| DirectGLES | **74.66%** | 67.12% | 86 | 8 | 0 | -| DirectVulkan | **73.05%** | 72.78% | 89 | 8 | 3 | +| DirectGLES | **74.93%** | 67.39% | 85 | 8 | 0 | +| DirectVulkan | **73.32%** | 73.05% | 88 | 8 | 3 | `textures_storage_multisample_*` is 54 of what remains on either backend and needs a feature rather than a fix: a multisample texture has to be attachable to diff --git a/tools/cts/skills/linux-gl-cts-on-mobilegl/SKILL.md b/tools/cts/skills/linux-gl-cts-on-mobilegl/SKILL.md index f151b9cd..c0e5ff03 100644 --- a/tools/cts/skills/linux-gl-cts-on-mobilegl/SKILL.md +++ b/tools/cts/skills/linux-gl-cts-on-mobilegl/SKILL.md @@ -147,8 +147,8 @@ mustpass list, Mesa 25.2.8, `--deqp-surface-type=fbo`. | backend | renderer | conformance | strict Pass | Fail | InternalError | Crash | | --- | --- | ---: | ---: | ---: | ---: | ---: | -| DirectGLES | Espryt | **74.66%** | 67.12% | 86 | 8 | 0 | -| DirectVulkan | Magma | **73.05%** | 72.78% | 89 | 8 | 3 | +| DirectGLES | Espryt | **74.93%** | 67.39% | 85 | 8 | 0 | +| DirectVulkan | Magma | **73.32%** | 73.05% | 88 | 8 | 3 | ## Contents