472226422e
The first time a shader is compiled Godot performs the following: ```cpp for (uint32_t i = 0; i < SHADER_STAGE_MAX; i++) { if (spirv_data.push_constant_stages_mask.has_flag((ShaderStage)(1 << i))) { binary_data.push_constant_vk_stages_mask |= shader_stage_masks[i]; } } ``` However binary_data.push_constant_vk_stages_mask is never initialized to 0 and thus contains garbage data or'ed with the good data. This value is used by push constants (and many other things) thus it can be a big deal. Fortunately because the relevant flags are always guaranteed to be set (but not guaranteed to be unset), the damage is restricted to: 1. Performance (unnecessary flushing & over-excessive barriers) 2. Overwriting push descriptors already set (this would be serious, doesn't seem to be an issue) 3. Driver implementations going crazy when they see bits set they don't expect (unknown if this is an issue) This uninitialized value is later saved into the binary cache. Valgrind is able to detect this bug on the first run, but not on the subsequent ones because they data comes from a file. cache_file_version has been bumped to force rebuild of all cached shaders. Because the ones generated so far are compromised. |
||
---|---|---|
.. | ||
effects | ||
environment | ||
forward_clustered | ||
forward_mobile | ||
shaders | ||
spirv-reflect | ||
storage_rd | ||
cluster_builder_rd.cpp | ||
cluster_builder_rd.h | ||
framebuffer_cache_rd.cpp | ||
framebuffer_cache_rd.h | ||
pipeline_cache_rd.cpp | ||
pipeline_cache_rd.h | ||
renderer_canvas_render_rd.cpp | ||
renderer_canvas_render_rd.h | ||
renderer_compositor_rd.cpp | ||
renderer_compositor_rd.h | ||
renderer_scene_render_rd.cpp | ||
renderer_scene_render_rd.h | ||
SCsub | ||
shader_rd.cpp | ||
shader_rd.h | ||
uniform_set_cache_rd.cpp | ||
uniform_set_cache_rd.h |