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. |
||
---|---|---|
.. | ||
dummy | ||
environment | ||
renderer_rd | ||
storage | ||
renderer_canvas_cull.cpp | ||
renderer_canvas_cull.h | ||
renderer_canvas_render.cpp | ||
renderer_canvas_render.h | ||
renderer_compositor.cpp | ||
renderer_compositor.h | ||
renderer_geometry_instance.cpp | ||
renderer_geometry_instance.h | ||
renderer_scene_cull.cpp | ||
renderer_scene_cull.h | ||
renderer_scene_occlusion_cull.cpp | ||
renderer_scene_occlusion_cull.h | ||
renderer_scene_render.cpp | ||
renderer_scene_render.h | ||
renderer_viewport.cpp | ||
renderer_viewport.h | ||
rendering_device.cpp | ||
rendering_device.h | ||
rendering_device_binds.cpp | ||
rendering_device_binds.h | ||
rendering_method.cpp | ||
rendering_method.h | ||
rendering_server_default.cpp | ||
rendering_server_default.h | ||
rendering_server_globals.cpp | ||
rendering_server_globals.h | ||
SCsub | ||
shader_compiler.cpp | ||
shader_compiler.h | ||
shader_language.cpp | ||
shader_language.h | ||
shader_preprocessor.cpp | ||
shader_preprocessor.h | ||
shader_types.cpp | ||
shader_types.h | ||
shader_warnings.cpp | ||
shader_warnings.h |