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

Rewrite textureProjLod usage to avoid a Vulkan validation error.

This commit is contained in:
Dario
2025-05-14 11:15:28 -03:00
parent 428a762e98
commit 499fff51fb
4 changed files with 35 additions and 25 deletions

View File

@@ -723,6 +723,7 @@ void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p
//print_line("w: " + itos(ssize.width) + " s: " + rtos(canvas_scale));
state_buffer.tex_to_sdf = 1.0 / ((canvas_scale.x + canvas_scale.y) * 0.5);
state_buffer.shadow_pixel_size = 1.0f / (float)(state.shadow_texture_size);
state_buffer.flags = use_linear_colors ? CANVAS_FLAGS_CONVERT_ATTRIBUTES_TO_LINEAR : 0;
@@ -1923,11 +1924,9 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() {
state.lights_uniform_buffer = RD::get_singleton()->uniform_buffer_create(sizeof(LightUniform) * state.max_lights_per_render);
RD::SamplerState shadow_sampler_state;
shadow_sampler_state.mag_filter = RD::SAMPLER_FILTER_LINEAR;
shadow_sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR;
shadow_sampler_state.mag_filter = RD::SAMPLER_FILTER_NEAREST;
shadow_sampler_state.min_filter = RD::SAMPLER_FILTER_NEAREST;
shadow_sampler_state.repeat_u = RD::SAMPLER_REPEAT_MODE_REPEAT; //shadow wrap around
shadow_sampler_state.compare_op = RD::COMPARE_OP_GREATER;
shadow_sampler_state.enable_compare = true;
state.shadow_sampler = RD::get_singleton()->sampler_create(shadow_sampler_state);
}