From 3b175fb88a00ffa66340a9da36c38d12a4112d4d Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Mon, 20 Jul 2026 01:38:30 -0400 Subject: [PATCH] [Fix] (MG_Impl/GLImpl): a multisample sample count above the format's maximum is INVALID_OPERATION, not INVALID_VALUE - matching both the spec and the native Adreno driver --- MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index 4a24ba85..522729e9 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -429,8 +429,10 @@ namespace MobileGL::MG_Impl::GLImpl { const Int maxSamples = GetMaxSupportedTextureSamples(textureInternalFormat); if (samples > maxSamples) { + // GL specifies INVALID_OPERATION - not INVALID_VALUE - when the sample count + // exceeds what the format supports, and the native Adreno driver agrees. MG_State::pGLContext->RecordError( - ErrorCode::InvalidValue, + ErrorCode::InvalidOperation, MakeUnique( "MG_Impl/GLImpl", caller, std::format("Sample count {} exceeds the supported maximum {} for this texture format.",