You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling the particles.glsl shader for an A12 or earlier device, it fails with the following error:
validateComputeFunctionArguments:1083: failed assertion `Compute Function(main0): argument src_particles[0] from buffer(4) with offset(0) and length(16) has space for 16 bytes, but argument has a length(128).'
Note
Disabling API validation allows the app to run.
The issue is that when using classic binding (i.e. not argument buffers), the ABI for the shader passes the structures as arguments to the entry point:
Note that the src_particles argument is a struct SourceEmission. Note again that this struct has an embedded type struct ParticleEmission[1]. Metal doesn't support unsized arrays, but SPRIV-Cross works around it by passing an embedded struct of size 1. Interestingly, Metal is a variant of C++, and even Godot's definition has to use a sized array for the structure definition:
When compiling the
particles.glsl
shader for an A12 or earlier device, it fails with the following error:Note
Disabling API validation allows the app to run.
The issue is that when using classic binding (i.e. not argument buffers), the ABI for the shader passes the structures as arguments to the entry point:
Note that the
src_particles
argument is astruct SourceEmission
. Note again that this struct has an embedded typestruct ParticleEmission[1]
. Metal doesn't support unsized arrays, but SPRIV-Cross works around it by passing an embedded struct of size1
. Interestingly, Metal is a variant of C++, and even Godot's definition has to use a sized array for the structure definition:godot/servers/rendering/renderer_rd/storage_rd/particles_storage.h
Line 157 in 2450dee
The issue is that when Godot binds an empty emission buffer, it does not need to account for this, so it allocates a size 16:
godot/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp
Line 544 in d9ef826
Originally posted by @TCROC in #99820 (comment)
The text was updated successfully, but these errors were encountered: