Merge branch 'dev' into Feat/Backend-Direct-GLES

This commit is contained in:
2025-10-27 13:42:31 +08:00
3 changed files with 51 additions and 31 deletions
+11 -4
View File
@@ -455,10 +455,17 @@ namespace MobileGL {
template <GLsizei VecCount, typename T>
void Uniform_State(MG_State::GLState::ProgramObject& programObject, GLuint location, T* value) {
auto size = programObject.GetUniformSizesInBytes(location);
auto offset = programObject.GetUniformOffset(location);
assert(size >= VecCount * sizeof(T));
memcpy((char*)programObject.MapUBO() + offset, value, VecCount * sizeof(T));
if (!programObject.IsUniformOpaqueAtLocation(location)) {
auto size = programObject.GetUniformSizesInBytes(location);
auto offset = programObject.GetUniformOffset(location);
assert(size >= VecCount * sizeof(T));
memcpy((char*)programObject.MapUBO() + offset, value, VecCount * sizeof(T));
} else {
auto* ttype = programObject.GetUniformTType(location);
if (ttype->isTexture() || ttype->isImage()) {
programObject.SetUniformSamplerOrImageUnitIndex(location, *value);
}
}
}
template <GLsizei VecCount, typename T>