Godot Version
4.5
Question
I am trying to add a new buffer to my compute shader for boids, so i figured i would copy 1 array that was already made and update the binding. When i add the 10th binding in the main gd file, as well as the 10th binding in the file included by the shader, i get this error:
E 0:00:00:780 main.gd:379 @ _run_compute_shader(): Uniforms supplied for set (0):
Set: 0 Binding: 0 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 1 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 2 Type: Image Writable: Y Length: 1
Set: 0 Binding: 3 Type: Image Writable: Y Length: 1
Set: 0 Binding: 4 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 5 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 6 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 7 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 8 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 9 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 10 Type: StorageBuffer Writable: Y Length: 0
are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:
Set: 0 Binding: 0 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 1 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 2 Type: Image Writable: Y Length: 1
Set: 0 Binding: 3 Type: Image Writable: Y Length: 1
Set: 0 Binding: 4 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 5 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 6 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 7 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 8 Type: StorageBuffer Writable: Y Length: 0
Set: 0 Binding: 9 Type: StorageBuffer Writable: Y Length: 0
<C++ Error> Method/function failed.
<C++ Source> servers/rendering/rendering_device.cpp:5313 @ compute_list_dispatch()
What i can see from this is that it “doesn’t see” the 10th binding in the main method. However, when i reduce the bindings to the 9th one, the errors become:
All the shader bindings for the given set must be covered by the uniforms provided. Binding (10), set (0) was not provided. (this is from uniform_set_create()) E 0:00:00:776 main.gd:377 @ _run_compute_shader(): Parameter “uniform_set” is null. <C++ Source> servers/rendering/rendering_device.cpp:5221 @ compute_list_bind_uniform_set() and E 0:00:00:776 main.gd:378 @ _run_compute_shader(): Uniforms were never supplied for set (0) at the time of drawing, which are required by the pipeline. <C++ Error> Method/function failed. <C++ Source> servers/rendering/rendering_device.cpp:5310 @ compute_list_dispatch()
3 separate errors. The last thing that i think might be a good pointer is that if i delete the contents of the included file, nothing changes. Both errors persist regardless of the contents of the file OR if the contents are placed directly in the compute shader file.
My main hypotheses are:
- Something in the tscn file is not pointing correctly (as was the case for a gdshader file that broke one time)
- the included file isn’t being read by a shader. In this script, there are 4 compute shaders being ran, each drawing from the same include file, and aside from the main shader, the other 3 are failing. they all have the same #include line, though…