|
703 | 703 | <param index="1" name="format" type="int" enum="RenderingDevice.IndexBufferFormat" />
|
704 | 704 | <param index="2" name="data" type="PackedByteArray" default="PackedByteArray()" />
|
705 | 705 | <param index="3" name="use_restart_indices" type="bool" default="false" />
|
706 |
| - <param index="4" name="enable_device_address" type="bool" default="false" /> |
| 706 | + <param index="4" name="creation_bits" type="int" enum="RenderingDevice.BufferCreationBits" is_bitfield="true" default="0" /> |
707 | 707 | <description>
|
708 | 708 | Creates a new index buffer. It can be accessed with the RID that is returned.
|
709 | 709 | Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
|
710 |
| - Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it. |
711 | 710 | </description>
|
712 | 711 | </method>
|
713 | 712 | <method name="limit_get" qualifiers="const">
|
|
847 | 846 | <param index="0" name="size_bytes" type="int" />
|
848 | 847 | <param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
|
849 | 848 | <param index="2" name="usage" type="int" enum="RenderingDevice.StorageBufferUsage" is_bitfield="true" default="0" />
|
| 849 | + <param index="3" name="creation_bits" type="int" enum="RenderingDevice.BufferCreationBits" is_bitfield="true" default="0" /> |
850 | 850 | <description>
|
851 | 851 | Creates a [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffer[/url] with the specified [param data] and [param usage]. It can be accessed with the RID that is returned.
|
852 | 852 | Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
|
|
1073 | 1073 | <return type="RID" />
|
1074 | 1074 | <param index="0" name="size_bytes" type="int" />
|
1075 | 1075 | <param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
|
1076 |
| - <param index="2" name="enable_device_address" type="bool" default="false" /> |
| 1076 | + <param index="2" name="creation_bits" type="int" enum="RenderingDevice.BufferCreationBits" is_bitfield="true" default="0" /> |
1077 | 1077 | <description>
|
1078 | 1078 | Creates a new uniform buffer. It can be accessed with the RID that is returned.
|
1079 | 1079 | Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
|
1080 |
| - Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it. |
1081 | 1080 | </description>
|
1082 | 1081 | </method>
|
1083 | 1082 | <method name="uniform_set_create">
|
|
1111 | 1110 | <return type="RID" />
|
1112 | 1111 | <param index="0" name="size_bytes" type="int" />
|
1113 | 1112 | <param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
|
1114 |
| - <param index="2" name="use_as_storage" type="bool" default="false" /> |
1115 |
| - <param index="3" name="enable_device_address" type="bool" default="false" /> |
| 1113 | + <param index="2" name="creation_bits" type="int" enum="RenderingDevice.BufferCreationBits" is_bitfield="true" default="0" /> |
1116 | 1114 | <description>
|
1117 | 1115 | It can be accessed with the RID that is returned.
|
1118 | 1116 | Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
|
1119 |
| - Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it. |
1120 | 1117 | </description>
|
1121 | 1118 | </method>
|
1122 | 1119 | <method name="vertex_format_create">
|
|
2068 | 2065 | </constant>
|
2069 | 2066 | <constant name="STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT" value="1" enum="StorageBufferUsage" is_bitfield="true">
|
2070 | 2067 | </constant>
|
2071 |
| - <constant name="STORAGE_BUFFER_USAGE_DEVICE_ADDRESS" value="2" enum="StorageBufferUsage" is_bitfield="true"> |
2072 |
| - Allows usage of [method buffer_get_device_address] on supported GPUs. |
| 2068 | + <constant name="BUFFER_CREATION_DEVICE_ADDRESS_BIT" value="1" enum="BufferCreationBits" is_bitfield="true"> |
| 2069 | + Optionally, set this flag if you wish to use [method buffer_get_device_address] functionality. You must first check the GPU supports it: |
| 2070 | + [codeblocks] |
| 2071 | + [gdscript] |
| 2072 | + rd = RenderingServer.get_rendering_device() |
| 2073 | + |
| 2074 | + if rd.has_feature(RenderingDevice.SUPPORTS_BUFFER_DEVICE_ADDRESS): |
| 2075 | + storage_buffer = rd.storage_buffer_create(bytes.size(), bytes, RenderingDevice.STORAGE_BUFFER_USAGE_SHADER_DEVICE_ADDRESS): |
| 2076 | + storage_buffer_address = rd.buffer_get_device_address(storage_buffer) |
| 2077 | + [/gdscript] |
| 2078 | + [/codeblocks] |
| 2079 | + </constant> |
| 2080 | + <constant name="BUFFER_CREATION_AS_STORAGE_BIT" value="2" enum="BufferCreationBits" is_bitfield="true"> |
| 2081 | + Set this flag so that it is created as storage. This is useful if Compute Shaders need access (for reading or writing) to the buffer, e.g. skeletal animations are processed in Compute Shaders which need access to vertex buffers, to be later consumed by vertex shaders as part of the regular rasterization pipeline. |
2073 | 2082 | </constant>
|
2074 | 2083 | <constant name="UNIFORM_TYPE_SAMPLER" value="0" enum="UniformType">
|
2075 | 2084 | Sampler uniform.
|
|
0 commit comments