mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
Merge branch 'dev' into Feat/Backend-Direct-GLES
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user