fix glMapBufferRange return null when r_index + last_item_index > max_instances
(cherry picked from commit d48b95a305
)
This commit is contained in:
parent
dfdb6e576c
commit
2e71f6a806
@ -1451,7 +1451,7 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) {
|
|||||||
void RasterizerCanvasGLES3::_add_to_batch(uint32_t &r_index, bool &r_batch_broken) {
|
void RasterizerCanvasGLES3::_add_to_batch(uint32_t &r_index, bool &r_batch_broken) {
|
||||||
state.canvas_instance_batches[state.current_batch_index].instance_count++;
|
state.canvas_instance_batches[state.current_batch_index].instance_count++;
|
||||||
r_index++;
|
r_index++;
|
||||||
if (r_index >= data.max_instances_per_buffer) {
|
if (r_index + state.last_item_index >= data.max_instances_per_buffer) {
|
||||||
// Copy over all data needed for rendering right away
|
// Copy over all data needed for rendering right away
|
||||||
// then go back to recording item commands.
|
// then go back to recording item commands.
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, state.canvas_instance_data_buffers[state.current_data_buffer_index].instance_buffers[state.current_instance_buffer_index]);
|
glBindBuffer(GL_ARRAY_BUFFER, state.canvas_instance_data_buffers[state.current_data_buffer_index].instance_buffers[state.current_instance_buffer_index]);
|
||||||
|
Loading…
Reference in New Issue
Block a user