Merge pull request #112481 from stuartcarnie/2d_canvas_vbos

Massively optimize canvas 2D rendering by using vertex buffers
This commit is contained in:
Thaddeus Crews
2025-11-14 14:23:02 -06:00
25 changed files with 893 additions and 256 deletions

View File

@ -9,6 +9,10 @@
<tutorials>
</tutorials>
<members>
<member name="binding" type="int" setter="set_binding" getter="get_binding" default="4294967295">
The index of the buffer in the vertex buffer array to bind this vertex attribute. When set to [code]-1[/code], it defaults to the index of the attribute.
[b]Note:[/b] You cannot mix binding explicitly assigned attributes with implicitly assigned ones (i.e. [code]-1[/code]). Either all attributes must have their binding set to [code]-1[/code], or all must have explicit bindings.
</member>
<member name="format" type="int" setter="set_format" getter="get_format" enum="RenderingDevice.DataFormat" default="232">
The way that this attribute's data is interpreted when sent to a shader.
</member>

View File

@ -335,6 +335,17 @@
Binds [param vertex_array] to the specified [param draw_list].
</description>
</method>
<method name="draw_list_bind_vertex_buffers_format">
<return type="void" />
<param index="0" name="draw_list" type="int" />
<param index="1" name="vertex_format" type="int" />
<param index="2" name="vertex_count" type="int" />
<param index="3" name="vertex_buffers" type="RID[]" />
<param index="4" name="offsets" type="PackedInt64Array" default="PackedInt64Array()" />
<description>
Binds a set of [param vertex_buffers] directly to the specified [param draw_list] using [param vertex_format] without creating a vertex array RID. Provide the number of vertices in [param vertex_count]; optional per-buffer byte [param offsets] may also be supplied.
</description>
</method>
<method name="draw_list_disable_scissor">
<return type="void" />
<param index="0" name="draw_list" type="int" />