If the allocation is small enough that it enters the
if (p_size <= SMALL_ALLOCATION_MAX_SIZE) {} block, Godot would call
vmaFindMemoryTypeIndexForBufferInfo with the wrong parameters.
This can cause vmaFindMemoryTypeIndexForBufferInfo to potentially
misbehave on some cards or drivers.
Fixes regression introduced in #102830
Might potentially reopen#101850 (I doubt it, but it's possible)
Must be backported to 4.4
This does not resolve the errors noted in #101696, as the project is
incorrectly binding incompatible uniform set descriptors, as set 0
and set 1 have a single `readonly` image and set 2 has a single
`writeonly` texture. The `RenderingDevice` is reporting the errors with
Metal, as it uses a different `_reflect_spirv`, which correctly
determines the read / write attribute. A separate PR will be required
to fix the shared `_reflect_spirv`
Helps #101696
This changes the default shader loading strategy, implemented in the
Metal driver, to compile the `MTLLibrary` on demand when the pipeline
is created, which reduces cold startup time on IPHONE target OSs.
Normally, the `MTLLibrary` is compiled from Metal source asynchronously
when Godot calls
`RenderingDeviceDriverMetal::shader_create_from_bytecode`; however, this
changes this behaviour on mobile platforms to do it on demand when the
pipeline is created, as noted in #96052, Godot will ask to create
many more shaders from bytecode than are initially required. Mobile
OSs like iOS are limited to compiling to shader libraries concurrently,
which results in a significant bottleneck.
This is not the default for macOS, as it can concurrently compile many
shaders at once, resulting in faster startup times for the Godot editor.
VMA handles memory allocation on certain devices better than our custom VK code, so we might as well use it
Co-authored-by: Matias N. Goldberg <dark_sylinc@yahoo.com.ar>
This avoids crashing on devices when a number of varyings greater than the device limit is used.
For now this accurately prints an error when compiling the shader, but the error text only pops up in the editor if the number of user varyings is above the limit.
PR #90993 needed to get rid of VMA_MEMORY_USAGE_AUTO_PREFER_HOST because
we no longer used vmaCreateBuffer so we could specify the allocation
callbacks.
This however resulted in the wrong memory pool being chosen, causing
signficant performance slowdown.
Indicate additional preferred flags to help VMA select the proper pool.
Fixes#101905