godot/drivers/vulkan
Matias N. Goldberg 472226422e Fix uninitialized variable ending up sent to Vulkan
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.
2023-07-29 18:28:33 -03:00
..
rendering_device_vulkan.cpp Fix uninitialized variable ending up sent to Vulkan 2023-07-29 18:28:33 -03:00
rendering_device_vulkan.h Add custom texture create function 2023-07-26 20:46:34 +10:00
SCsub Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
vulkan_context.cpp Fix dangling pointers in _clean_up_swap_chain 2023-07-25 14:41:57 +02:00
vulkan_context.h Enabling additional vulkan extension and adding further checks 2023-01-15 14:49:15 +11:00
vulkan_hooks.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00