Skip to content

Commit

Permalink
Merge pull request #58150 from lawnjelly/draw_gui_primitive_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Feb 15, 2022
2 parents 9343c66 + 3dc0e97 commit 685d4b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/gles2/rasterizer_canvas_base_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions drivers/gles3/rasterizer_canvas_base_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 685d4b4

Please sign in to comment.