Fix incorrect buffer upload size in GLES2 draw_gui_primitive
The buffer upload size appears to have been incorrect for quite some time, which causes uploading from undefined memory.
This commit is contained in:
parent
6235bd2a78
commit
3dc0e97d05
@ -672,7 +672,7 @@ void RasterizerCanvasBaseGLES2::_draw_gui_primitive(int p_points, const Vector2
|
||||
}
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
|
||||
storage->buffer_orphan_and_upload(data.polygon_buffer_size, 0, p_points * stride * 4 * sizeof(float), buffer_data, GL_ARRAY_BUFFER, _buffer_upload_usage_flag, true);
|
||||
storage->buffer_orphan_and_upload(data.polygon_buffer_size, 0, p_points * stride * sizeof(float), buffer_data, GL_ARRAY_BUFFER, _buffer_upload_usage_flag, true);
|
||||
|
||||
glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, stride * sizeof(float), nullptr);
|
||||
|
||||
|
@ -585,8 +585,7 @@ void RasterizerCanvasBaseGLES3::_draw_gui_primitive(int p_points, const Vector2
|
||||
}
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
|
||||
//TODO the below call may need to be replaced with: p_points * stride * 4 * sizeof(float), &b[0]);
|
||||
storage->buffer_orphan_and_upload(data.polygon_buffer_size, 0, p_points * stride * 4, &b[0], GL_ARRAY_BUFFER, _buffer_upload_usage_flag);
|
||||
storage->buffer_orphan_and_upload(data.polygon_buffer_size, 0, p_points * stride * sizeof(float), &b[0], GL_ARRAY_BUFFER, _buffer_upload_usage_flag);
|
||||
|
||||
glBindVertexArray(data.polygon_buffer_quad_arrays[version]);
|
||||
glDrawArrays(prim[p_points], 0, p_points);
|
||||
|
Loading…
Reference in New Issue
Block a user