Rename RD uniform "type" to "uniform_type"

"type" isn't very descriptive for exposed code, and this variable is exposed via RD_SETGET.
This commit is contained in:
Aaron Franke 2020-10-16 21:19:21 -04:00
parent 40b81339d0
commit 19bdd01438
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
12 changed files with 281 additions and 281 deletions

View file

@ -31,7 +31,7 @@
<members>
<member name="binding" type="int" setter="set_binding" getter="get_binding" default="0">
</member>
<member name="type" type="int" setter="set_type" getter="get_type" enum="RenderingDevice.UniformType" default="3">
<member name="uniform_type" type="int" setter="set_uniform_type" getter="get_uniform_type" enum="RenderingDevice.UniformType" default="3">
</member>
</members>
<constants>

View file

@ -4612,8 +4612,8 @@ RID RenderingDeviceVulkan::uniform_set_create(const Vector<Uniform> &p_uniforms,
const Uniform &uniform = uniforms[uniform_idx];
ERR_FAIL_COND_V_MSG(uniform.type != set_uniform.type, RID(),
"Mismatch uniform type for binding (" + itos(set_uniform.binding) + "), set (" + itos(p_shader_set) + "). Expected '" + shader_uniform_names[set_uniform.type] + "', supplied: '" + shader_uniform_names[uniform.type] + "'.");
ERR_FAIL_COND_V_MSG(uniform.uniform_type != set_uniform.type, RID(),
"Mismatch uniform type for binding (" + itos(set_uniform.binding) + "), set (" + itos(p_shader_set) + "). Expected '" + shader_uniform_names[set_uniform.type] + "', supplied: '" + shader_uniform_names[uniform.uniform_type] + "'.");
VkWriteDescriptorSet write; //common header
write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
@ -4628,7 +4628,7 @@ RID RenderingDeviceVulkan::uniform_set_create(const Vector<Uniform> &p_uniforms,
write.pTexelBufferView = nullptr;
uint32_t type_size = 1;
switch (uniform.type) {
switch (uniform.uniform_type) {
case UNIFORM_TYPE_SAMPLER: {
if (uniform.ids.size() != set_uniform.length) {
if (set_uniform.length > 1) {

View file

@ -826,84 +826,84 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
{
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 1;
u.ids.push_back(vertex_buffer);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 2;
u.ids.push_back(triangle_buffer);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 3;
u.ids.push_back(box_buffer);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 4;
u.ids.push_back(triangle_cell_indices_buffer);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 5;
u.ids.push_back(lights_buffer);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 6;
u.ids.push_back(seams_buffer);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 7;
u.ids.push_back(probe_positions_buffer);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 8;
u.ids.push_back(grid_texture);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 9;
u.ids.push_back(grid_texture_sdf);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 10;
u.ids.push_back(albedo_array_tex);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 11;
u.ids.push_back(emission_array_tex);
base_uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 12;
u.ids.push_back(sampler);
base_uniforms.push_back(u);
@ -1049,14 +1049,14 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
{
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 0;
u.ids.push_back(position_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 1;
u.ids.push_back(unocclude_tex); //will be unused
uniforms.push_back(u);
@ -1089,42 +1089,42 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
{
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 0;
u.ids.push_back(light_source_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1;
u.ids.push_back(light_dest_tex); //will be unused
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 2;
u.ids.push_back(position_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 3;
u.ids.push_back(normal_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 4;
u.ids.push_back(light_accum_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 5;
u.ids.push_back(light_primary_dynamic_tex);
uniforms.push_back(u);
@ -1169,49 +1169,49 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
{
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 0;
u.ids.push_back(light_dest_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1;
u.ids.push_back(light_source_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 2;
u.ids.push_back(position_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 3;
u.ids.push_back(normal_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 4;
u.ids.push_back(light_accum_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 5;
u.ids.push_back(unocclude_tex); //reuse unocclude tex
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 6;
u.ids.push_back(light_environment_tex); //reuse unocclude tex
uniforms.push_back(u);
@ -1317,28 +1317,28 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
{
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 0;
u.ids.push_back(light_probe_buffer);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1;
u.ids.push_back(light_dest_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 2;
u.ids.push_back(light_primary_dynamic_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 3;
u.ids.push_back(light_environment_tex);
uniforms.push_back(u);
@ -1463,14 +1463,14 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
{
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 0;
u.ids.push_back(light_accum_tex);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1;
u.ids.push_back(light_accum_tex2);
uniforms.push_back(u);
@ -1554,7 +1554,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
{
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 0;
u.ids.push_back(light_accum_tex2);
uniforms.push_back(u);

View file

@ -67,7 +67,7 @@ RID EffectsRD::_get_uniform_set_from_image(RID p_image) {
}
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 0;
u.ids.push_back(p_image);
uniforms.push_back(u);
@ -89,7 +89,7 @@ RID EffectsRD::_get_uniform_set_from_texture(RID p_texture, bool p_use_mipmaps)
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.binding = 0;
u.ids.push_back(p_use_mipmaps ? default_mipmap_sampler : default_sampler);
u.ids.push_back(p_texture);
@ -112,7 +112,7 @@ RID EffectsRD::_get_compute_uniform_set_from_texture(RID p_texture, bool p_use_m
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.binding = 0;
u.ids.push_back(p_use_mipmaps ? default_mipmap_sampler : default_sampler);
u.ids.push_back(p_texture);
@ -140,7 +140,7 @@ RID EffectsRD::_get_compute_uniform_set_from_texture_pair(RID p_texture1, RID p_
Vector<RD::Uniform> uniforms;
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.binding = 0;
u.ids.push_back(p_use_mipmaps ? default_mipmap_sampler : default_sampler);
u.ids.push_back(p_texture1);
@ -148,7 +148,7 @@ RID EffectsRD::_get_compute_uniform_set_from_texture_pair(RID p_texture1, RID p_
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.binding = 1;
u.ids.push_back(p_use_mipmaps ? default_mipmap_sampler : default_sampler);
u.ids.push_back(p_texture2);
@ -177,14 +177,14 @@ RID EffectsRD::_get_compute_uniform_set_from_image_pair(RID p_texture1, RID p_te
Vector<RD::Uniform> uniforms;
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 0;
u.ids.push_back(p_texture1);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 1;
u.ids.push_back(p_texture2);
uniforms.push_back(u);
@ -1171,7 +1171,7 @@ void EffectsRD::cubemap_filter(RID p_source_cubemap, Vector<RID> p_dest_cubemap,
Vector<RD::Uniform> uniforms;
for (int i = 0; i < p_dest_cubemap.size(); i++) {
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = i;
u.ids.push_back(p_dest_cubemap[i]);
uniforms.push_back(u);
@ -1591,7 +1591,7 @@ EffectsRD::EffectsRD() {
Vector<RD::Uniform> uniforms;
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 0;
u.ids.push_back(filter.coefficient_buffer);
uniforms.push_back(u);

View file

@ -1022,7 +1022,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.binding = 1;
u.ids.push_back(state.canvas_state_buffer);
uniforms.push_back(u);
@ -1030,7 +1030,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.binding = 2;
u.ids.push_back(state.lights_uniform_buffer);
uniforms.push_back(u);
@ -1038,7 +1038,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 3;
u.ids.push_back(storage->decal_atlas_get_texture());
uniforms.push_back(u);
@ -1046,7 +1046,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 4;
u.ids.push_back(state.shadow_texture);
uniforms.push_back(u);
@ -1054,7 +1054,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 5;
u.ids.push_back(state.shadow_sampler);
uniforms.push_back(u);
@ -1062,7 +1062,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 6;
RID screen;
if (p_backbuffer) {
@ -1079,7 +1079,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 7;
RID sdf = storage->render_target_get_sdf_texture(p_to_render_target);
u.ids.push_back(sdf);
@ -1089,7 +1089,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
//needs samplers for the material (uses custom textures) create them
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 8;
u.ids.resize(12);
RID *ids_ptr = u.ids.ptrw();
@ -1110,7 +1110,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 9;
u.ids.push_back(storage->global_variables_get_storage_buffer());
uniforms.push_back(u);
@ -2320,7 +2320,7 @@ void RendererCanvasRenderRD::MaterialData::update_parameters(const Map<StringNam
{
if (shader_data->ubo_size) {
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.binding = 0;
u.ids.push_back(uniform_buffer);
uniforms.push_back(u);
@ -2329,7 +2329,7 @@ void RendererCanvasRenderRD::MaterialData::update_parameters(const Map<StringNam
const RID *textures = texture_cache.ptrw();
for (uint32_t i = 0; i < tex_uniform_count; i++) {
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1 + i;
u.ids.push_back(textures[i]);
uniforms.push_back(u);
@ -2681,7 +2681,7 @@ RendererCanvasRenderRD::RendererCanvasRenderRD(RendererStorageRD *p_storage) {
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 0;
u.ids.push_back(storage->get_default_rd_storage_buffer());
uniforms.push_back(u);

View file

@ -47,7 +47,7 @@ void RendererCompositorRD::blit_render_targets_to_screen(DisplayServer::WindowID
if (!render_target_descriptors.has(rd_texture) || !RD::get_singleton()->uniform_set_is_valid(render_target_descriptors[rd_texture])) {
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u.binding = 0;
u.ids.push_back(copy_viewports_sampler);
u.ids.push_back(rd_texture);

View file

@ -479,7 +479,7 @@ void RendererSceneRenderForward::MaterialData::update_parameters(const Map<Strin
{
if (shader_data->ubo_size) {
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.binding = 0;
u.ids.push_back(uniform_buffer);
uniforms.push_back(u);
@ -488,7 +488,7 @@ void RendererSceneRenderForward::MaterialData::update_parameters(const Map<Strin
const RID *textures = texture_cache.ptrw();
for (uint32_t i = 0; i < tex_uniform_count; i++) {
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1 + i;
u.ids.push_back(textures[i]);
uniforms.push_back(u);
@ -2202,28 +2202,28 @@ void RendererSceneRenderForward::_render_sdfgi(RID p_render_buffers, const Vecto
Vector<RD::Uniform> uniforms;
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 0;
u.ids.push_back(p_albedo_texture);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 1;
u.ids.push_back(p_emission_texture);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 2;
u.ids.push_back(p_emission_aniso_texture);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 3;
u.ids.push_back(p_geom_facing_texture);
uniforms.push_back(u);
@ -2311,7 +2311,7 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 1;
u.ids.resize(12);
RID *ids_ptr = u.ids.ptrw();
@ -2333,7 +2333,7 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.binding = 2;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER;
u.ids.push_back(shadow_sampler);
uniforms.push_back(u);
}
@ -2341,14 +2341,14 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.binding = 3;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.ids.push_back(scene_state.uniform_buffer);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 4;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.ids.push_back(scene_state.instance_buffer);
uniforms.push_back(u);
}
@ -2356,7 +2356,7 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.binding = 5;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.ids.push_back(get_positional_light_buffer());
uniforms.push_back(u);
}
@ -2364,42 +2364,42 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.binding = 6;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.ids.push_back(get_reflection_probe_buffer());
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 7;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.ids.push_back(get_directional_light_buffer());
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 10;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.ids.push_back(scene_state.lightmap_buffer);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 11;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.ids = storage->lightmap_array_get_textures();
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 12;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.ids.push_back(scene_state.lightmap_capture_buffer);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 13;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID decal_atlas = storage->decal_atlas_get_texture();
u.ids.push_back(decal_atlas);
uniforms.push_back(u);
@ -2407,7 +2407,7 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.binding = 14;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID decal_atlas = storage->decal_atlas_get_texture_srgb();
u.ids.push_back(decal_atlas);
uniforms.push_back(u);
@ -2415,7 +2415,7 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.binding = 15;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.ids.push_back(get_decal_buffer());
uniforms.push_back(u);
}
@ -2423,14 +2423,14 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.binding = 16;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.ids.push_back(get_cluster_builder_texture());
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 17;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.ids.push_back(get_cluster_builder_indices_buffer());
uniforms.push_back(u);
}
@ -2438,7 +2438,7 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.binding = 18;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
if (directional_shadow_get_texture().is_valid()) {
u.ids.push_back(directional_shadow_get_texture());
} else {
@ -2449,7 +2449,7 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 19;
u.ids.push_back(storage->global_variables_get_storage_buffer());
uniforms.push_back(u);
@ -2457,7 +2457,7 @@ void RendererSceneRenderForward::_update_render_base_uniform_set() {
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.binding = 20;
u.ids.push_back(sdfgi_get_ubo());
uniforms.push_back(u);
@ -2480,7 +2480,7 @@ void RendererSceneRenderForward::_setup_view_dependant_uniform_set(RID p_shadow_
RID ref_texture = p_reflection_atlas.is_valid() ? reflection_atlas_get_texture(p_reflection_atlas) : RID();
RD::Uniform u;
u.binding = 0;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
if (ref_texture.is_valid()) {
u.ids.push_back(ref_texture);
} else {
@ -2492,7 +2492,7 @@ void RendererSceneRenderForward::_setup_view_dependant_uniform_set(RID p_shadow_
{
RD::Uniform u;
u.binding = 1;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture;
if (p_shadow_atlas.is_valid()) {
texture = shadow_atlas_get_texture(p_shadow_atlas);
@ -2507,7 +2507,7 @@ void RendererSceneRenderForward::_setup_view_dependant_uniform_set(RID p_shadow_
{
RD::Uniform u;
u.binding = 2;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID default_tex = storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_3D_WHITE);
for (int i = 0; i < MAX_GI_PROBES; i++) {
if (i < p_gi_probe_cull_count) {
@ -2565,7 +2565,7 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 0;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = false && rb->depth.is_valid() ? rb->depth : storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_WHITE);
u.ids.push_back(texture);
uniforms.push_back(u);
@ -2573,7 +2573,7 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 1;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID bbt = render_buffers_get_back_buffer_texture(p_render_buffers);
RID texture = bbt.is_valid() ? bbt : storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_BLACK);
u.ids.push_back(texture);
@ -2582,7 +2582,7 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 2;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = rb->normal_roughness_buffer.is_valid() ? rb->normal_roughness_buffer : storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_NORMAL);
u.ids.push_back(texture);
uniforms.push_back(u);
@ -2591,7 +2591,7 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 4;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID aot = render_buffers_get_ao_texture(p_render_buffers);
RID texture = aot.is_valid() ? aot : storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_BLACK);
u.ids.push_back(texture);
@ -2601,7 +2601,7 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 5;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = rb->ambient_buffer.is_valid() ? rb->ambient_buffer : storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_BLACK);
u.ids.push_back(texture);
uniforms.push_back(u);
@ -2610,7 +2610,7 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 6;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = rb->reflection_buffer.is_valid() ? rb->reflection_buffer : storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_BLACK);
u.ids.push_back(texture);
uniforms.push_back(u);
@ -2618,7 +2618,7 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 7;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID t;
if (render_buffers_is_sdfgi_enabled(p_render_buffers)) {
t = render_buffers_get_sdfgi_irradiance_probes(p_render_buffers);
@ -2631,7 +2631,7 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 8;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
if (render_buffers_is_sdfgi_enabled(p_render_buffers)) {
u.ids.push_back(render_buffers_get_sdfgi_occlusion_texture(p_render_buffers));
} else {
@ -2642,14 +2642,14 @@ void RendererSceneRenderForward::_update_render_buffers_uniform_set(RID p_render
{
RD::Uniform u;
u.binding = 9;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.ids.push_back(render_buffers_get_gi_probe_buffer(p_render_buffers));
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 10;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID vfog = RID();
if (p_render_buffers.is_valid() && render_buffers_has_volumetric_fog(p_render_buffers)) {
vfog = render_buffers_get_volumetric_fog_texture(p_render_buffers);
@ -2943,7 +2943,7 @@ RendererSceneRenderForward::RendererSceneRenderForward(RendererStorageRD *p_stor
default_vec4_xform_buffer = RD::get_singleton()->storage_buffer_create(256);
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.ids.push_back(default_vec4_xform_buffer);
u.binding = 0;
uniforms.push_back(u);
@ -2964,7 +2964,7 @@ RendererSceneRenderForward::RendererSceneRenderForward(RendererStorageRD *p_stor
RD::Uniform u;
u.binding = 0;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = storage->texture_rd_get_default(is_using_radiance_cubemap_array() ? RendererStorageRD::DEFAULT_RD_TEXTURE_CUBEMAP_ARRAY_BLACK : RendererStorageRD::DEFAULT_RD_TEXTURE_CUBEMAP_BLACK);
u.ids.push_back(texture);
uniforms.push_back(u);
@ -2977,7 +2977,7 @@ RendererSceneRenderForward::RendererSceneRenderForward(RendererStorageRD *p_stor
for (int i = 0; i < 7; i++) {
RD::Uniform u;
u.binding = i;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = storage->texture_rd_get_default(i == 0 ? RendererStorageRD::DEFAULT_RD_TEXTURE_WHITE : (i == 2 ? RendererStorageRD::DEFAULT_RD_TEXTURE_NORMAL : RendererStorageRD::DEFAULT_RD_TEXTURE_BLACK));
u.ids.push_back(texture);
uniforms.push_back(u);
@ -2985,7 +2985,7 @@ RendererSceneRenderForward::RendererSceneRenderForward(RendererStorageRD *p_stor
{
RD::Uniform u;
u.binding = 7;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_2D_ARRAY_WHITE);
u.ids.push_back(texture);
uniforms.push_back(u);
@ -2993,21 +2993,21 @@ RendererSceneRenderForward::RendererSceneRenderForward(RendererStorageRD *p_stor
{
RD::Uniform u;
u.binding = 8;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.ids.push_back(storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_3D_WHITE));
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 9;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.ids.push_back(render_buffers_get_default_gi_probe_buffer());
uniforms.push_back(u);
}
{
RD::Uniform u;
u.binding = 10;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.ids.push_back(storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_3D_WHITE));
uniforms.push_back(u);
}

File diff suppressed because it is too large Load diff

View file

@ -1298,7 +1298,7 @@ bool RendererStorageRD::canvas_texture_get_uniform_set(RID p_texture, RS::Canvas
Vector<RD::Uniform> uniforms;
{ //diffuse
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 0;
t = texture_owner.getornull(ct->diffuse);
@ -1313,7 +1313,7 @@ bool RendererStorageRD::canvas_texture_get_uniform_set(RID p_texture, RS::Canvas
}
{ //normal
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1;
t = texture_owner.getornull(ct->normalmap);
@ -1328,7 +1328,7 @@ bool RendererStorageRD::canvas_texture_get_uniform_set(RID p_texture, RS::Canvas
}
{ //specular
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 2;
t = texture_owner.getornull(ct->specular);
@ -1343,7 +1343,7 @@ bool RendererStorageRD::canvas_texture_get_uniform_set(RID p_texture, RS::Canvas
}
{ //sampler
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 3;
u.ids.push_back(sampler_rd_get_default(filter, repeat));
uniforms.push_back(u);
@ -3591,14 +3591,14 @@ void RendererStorageRD::particles_set_amount(RID p_particles, int p_amount) {
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 1;
u.ids.push_back(particles->particle_buffer);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 2;
u.ids.push_back(particles->particle_instance_buffer);
uniforms.push_back(u);
@ -3901,14 +3901,14 @@ void RendererStorageRD::_particles_process(Particles *p_particles, float p_delta
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 0;
u.ids.push_back(p_particles->frame_params_buffer);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 1;
u.ids.push_back(p_particles->particle_buffer);
uniforms.push_back(u);
@ -3916,7 +3916,7 @@ void RendererStorageRD::_particles_process(Particles *p_particles, float p_delta
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 2;
if (p_particles->emission_storage_buffer.is_valid()) {
u.ids.push_back(p_particles->emission_storage_buffer);
@ -3927,7 +3927,7 @@ void RendererStorageRD::_particles_process(Particles *p_particles, float p_delta
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 3;
Particles *sub_emitter = particles_owner.getornull(p_particles->sub_emitter);
if (sub_emitter) {
@ -4134,7 +4134,7 @@ void RendererStorageRD::_particles_process(Particles *p_particles, float p_delta
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 0;
for (uint32_t i = 0; i < ParticlesFrameParams::MAX_3D_TEXTURES; i++) {
RID rd_tex;
@ -4154,7 +4154,7 @@ void RendererStorageRD::_particles_process(Particles *p_particles, float p_delta
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1;
if (collision_heightmap_texture.is_valid()) {
u.ids.push_back(collision_heightmap_texture);
@ -4255,7 +4255,7 @@ void RendererStorageRD::particles_set_view_axis(RID p_particles, const Vector3 &
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 0;
u.ids.push_back(particles->particles_sort_buffer);
uniforms.push_back(u);
@ -4614,7 +4614,7 @@ void RendererStorageRD::ParticlesMaterialData::update_parameters(const Map<Strin
{
if (shader_data->ubo_size) {
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
u.binding = 0;
u.ids.push_back(uniform_buffer);
uniforms.push_back(u);
@ -4623,7 +4623,7 @@ void RendererStorageRD::ParticlesMaterialData::update_parameters(const Map<Strin
const RID *textures = texture_cache.ptrw();
for (uint32_t i = 0; i < tex_uniform_count; i++) {
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_TEXTURE;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
u.binding = 1 + i;
u.ids.push_back(textures[i]);
uniforms.push_back(u);
@ -5617,21 +5617,21 @@ void RendererStorageRD::gi_probe_allocate(RID p_gi_probe, const Transform &p_to_
Vector<RD::Uniform> uniforms;
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 1;
u.ids.push_back(gi_probe->octree_buffer);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 2;
u.ids.push_back(gi_probe->data_buffer);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 3;
u.ids.push_back(shared_tex);
uniforms.push_back(u);
@ -6494,28 +6494,28 @@ void RendererStorageRD::_render_target_allocate_sdf(RenderTarget *rt) {
Vector<RD::Uniform> uniforms;
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 1;
u.ids.push_back(rt->sdf_buffer_write);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 2;
u.ids.push_back(rt->sdf_buffer_read);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 3;
u.ids.push_back(rt->sdf_buffer_process[0]);
uniforms.push_back(u);
}
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_IMAGE;
u.uniform_type = RD::UNIFORM_TYPE_IMAGE;
u.binding = 4;
u.ids.push_back(rt->sdf_buffer_process[1]);
uniforms.push_back(u);
@ -8453,7 +8453,7 @@ RendererStorageRD::RendererStorageRD() {
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_SAMPLER;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER;
u.binding = 1;
u.ids.resize(12);
RID *ids_ptr = u.ids.ptrw();
@ -8474,7 +8474,7 @@ RendererStorageRD::RendererStorageRD() {
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 2;
u.ids.push_back(global_variables_get_storage_buffer());
uniforms.push_back(u);

View file

@ -1463,7 +1463,7 @@ public:
if (!multimesh->uniform_set_3d.is_valid()) {
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 0;
u.ids.push_back(multimesh->buffer);
uniforms.push_back(u);
@ -1511,7 +1511,7 @@ public:
if (!skeleton->uniform_set_3d.is_valid()) {
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 0;
u.ids.push_back(skeleton->buffer);
uniforms.push_back(u);
@ -1900,7 +1900,7 @@ public:
{
RD::Uniform u;
u.type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
u.binding = 0;
u.ids.push_back(particles->particle_instance_buffer);
uniforms.push_back(u);

View file

@ -629,7 +629,7 @@ public:
virtual RID texture_buffer_create(uint32_t p_size_elements, DataFormat p_format, const Vector<uint8_t> &p_data = Vector<uint8_t>()) = 0;
struct Uniform {
UniformType type;
UniformType uniform_type;
int binding; //binding index as specified in shader
//for single items, provide one ID, for
@ -640,7 +640,7 @@ public:
Vector<RID> ids;
Uniform() {
type = UNIFORM_TYPE_IMAGE;
uniform_type = UNIFORM_TYPE_IMAGE;
binding = 0;
}
};

View file

@ -392,7 +392,7 @@ class RDUniform : public Reference {
RD::Uniform base;
public:
RD_SETGET(RD::UniformType, type)
RD_SETGET(RD::UniformType, uniform_type)
RD_SETGET(int32_t, binding)
void add_id(const RID &p_id) { base.ids.push_back(p_id); }
@ -415,7 +415,7 @@ protected:
}
}
static void _bind_methods() {
RD_BIND(Variant::INT, RDUniform, type);
RD_BIND(Variant::INT, RDUniform, uniform_type);
RD_BIND(Variant::INT, RDUniform, binding);
ClassDB::bind_method(D_METHOD("add_id", "id"), &RDUniform::add_id);
ClassDB::bind_method(D_METHOD("clear_ids"), &RDUniform::clear_ids);