mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 22:43:24 +09:00
[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user