GPU: add assert for immBegin buffer size & context
This commit is contained in:
parent
54eb701978
commit
0da05720de
|
@ -99,6 +99,10 @@ static void drw_deferred_shader_compilation_exec(void *custom_data,
|
|||
DRWShaderCompiler *comp = (DRWShaderCompiler *)custom_data;
|
||||
void *gl_context = comp->gl_context;
|
||||
|
||||
#if TRUST_NO_ONE
|
||||
BLI_assert(gl_context != NULL);
|
||||
#endif
|
||||
|
||||
WM_opengl_context_activate(gl_context);
|
||||
|
||||
while (true) {
|
||||
|
|
|
@ -275,6 +275,14 @@ void immBegin(GPUPrimType prim_type, uint vertex_len)
|
|||
|
||||
/* printf("mapping %u to %u\n", imm.buffer_offset, imm.buffer_offset + bytes_needed - 1); */
|
||||
|
||||
#if TRUST_NO_ONE
|
||||
{
|
||||
GLint bufsize;
|
||||
glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &bufsize);
|
||||
assert(active_buffer->buffer_offset + bytes_needed <= bufsize);
|
||||
}
|
||||
#endif
|
||||
|
||||
active_buffer->buffer_data = glMapBufferRange(
|
||||
GL_ARRAY_BUFFER,
|
||||
active_buffer->buffer_offset,
|
||||
|
|
Loading…
Reference in New Issue