1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Reduce the number of samplers used by the scene shaders

The hard limit for Apple devices is 16 samplers per stage. So we need to ensure we use less than that
This commit is contained in:
clayjohn
2023-12-15 17:13:44 -07:00
parent f8a2a91936
commit a5399ab5af
8 changed files with 53 additions and 62 deletions

View File

@@ -2972,7 +2972,13 @@ void RenderForwardClustered::_update_render_base_uniform_set() {
uniforms.push_back(u);
}
uniforms.append_array(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default().get_uniforms(14));
{
RD::Uniform u;
u.binding = 14;
u.uniform_type = RD::UNIFORM_TYPE_SAMPLER;
u.append_id(RendererRD::MaterialStorage::get_singleton()->sampler_rd_get_default(RS::CanvasItemTextureFilter::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CanvasItemTextureRepeat::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED));
uniforms.push_back(u);
}
render_base_uniform_set = RD::get_singleton()->uniform_set_create(uniforms, scene_shader.default_shader_rd, SCENE_UNIFORM_SET);
}