[Fix] (Shader): keep ESSL 3.10 block-array indexing and image-uniform rules for sources that declared an es version

This commit is contained in:
2026-10-12 08:32:49 -04:00
parent e98c5b4a6a
commit 1469022b53
11 changed files with 220 additions and 7 deletions
@@ -1581,6 +1581,16 @@ namespace MobileGL::MG_Impl::GLImpl {
} else {
const auto& ttype = programObject.GetUniformTypeFacts(location);
if (!ttype.isTexture && !ttype.isImage) return;
// ESSL 3.10 has no way to re-point an image uniform: its unit is the binding layout
// qualifier, and ES 3.1 core 7.6.1 makes every Uniform* on one INVALID_OPERATION.
// Desktop GL sets the unit with Uniform1i, so only a program built from `es` sources.
if (ttype.isImage && programObject.IsEsOrigin()) {
MG_State::pGLContext->RecordError(
ErrorCode::InvalidOperation,
MakeUnique<GenericErrorInfo>("MG_Impl/GLImpl", __func__,
"An image uniform of an ES shader cannot be set with Uniform*."));
return;
}
if constexpr (!std::is_same_v<std::remove_cv_t<T>, GLint> || ItemCount != 1) {
MG_State::pGLContext->RecordError(
ErrorCode::InvalidOperation,