mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:01:09 +02:00
Add a simple check on the uniform buffer slot to make sure it s valid
This commit is contained in:
parent
ec1c99cb71
commit
3f977a6743
1 changed files with 4 additions and 0 deletions
|
@ -149,6 +149,10 @@ void GLBackend::resetUniformStage() {
|
||||||
|
|
||||||
void GLBackend::do_setUniformBuffer(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setUniformBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
GLuint slot = batch._params[paramOffset + 3]._uint;
|
GLuint slot = batch._params[paramOffset + 3]._uint;
|
||||||
|
if (slot > GLBackend::MAX_NUM_UNIFORM_BUFFERS) {
|
||||||
|
// "GLBackend::do_setUniformBuffer: Trying to set a uniform Buffer at slot #" + slot + " which doesn't exist. MaxNumUniformBuffers = " + getMaxNumUniformBuffers());
|
||||||
|
return;
|
||||||
|
}
|
||||||
BufferPointer uniformBuffer = batch._buffers.get(batch._params[paramOffset + 2]._uint);
|
BufferPointer uniformBuffer = batch._buffers.get(batch._params[paramOffset + 2]._uint);
|
||||||
GLintptr rangeStart = batch._params[paramOffset + 1]._uint;
|
GLintptr rangeStart = batch._params[paramOffset + 1]._uint;
|
||||||
GLsizeiptr rangeSize = batch._params[paramOffset + 0]._uint;
|
GLsizeiptr rangeSize = batch._params[paramOffset + 0]._uint;
|
||||||
|
|
Loading…
Reference in a new issue