Godot Version 4.5.1 stable
Replace this line with your Godot version
Question
I have a buffer array as such in my .glsl compute shader:
layout(set = 0, binding = 1, std430) restrict readonly buffer lightmap_buffers {float lightmap[];} lightmaps_array[10];
i add buffers as such:
lightmaps_uniform.add_id(light_buffer1)
lightmaps_uniform.add_id(light_buffer2)
If i add one buffer the shader works, as soon as i add a second it crashes. I’m a bit at loss on how to make it work, if anyone knows how i’d love it.
The context is i have nodes calculating lightmaps, and i’m trying to bind the outputs buffer directly to the shader that will mix them. Below are the relevant script part and .glsl
#[compute]
#version 450
layout(set = 0, binding = 0, std430) restrict readonly buffer input_buffer{
int lightmaps_number;
float padd1;
float padd2;
float padd3;
vec4 colors[];
};
layout(set = 0, binding = 1, std430) restrict readonly buffer lightmap_buffers {float lightmap[];} lightmaps_array[10];
layout(set = 0, binding = 2, std430) restrict writeonly buffer output_buffer{
float storage_data[];
};
layout(local_size_x = 64, local_size_y =1, local_size_z =1) in;
void main(){
storage_data[4*(64*gl_WorkGroupID.x + gl_LocalInvocationID.x)] = 1;
storage_data[4*(64*gl_WorkGroupID.x + gl_LocalInvocationID.x)+1] = 1;
storage_data[4*(64*gl_WorkGroupID.x + gl_LocalInvocationID.x)+2] = 1;
storage_data[4*(64*gl_WorkGroupID.x + gl_LocalInvocationID.x)+3] = 1;
return;
}
What are the error messages?

here they are! and the script:
Try to put lightmaps_uniform to the last (largest) binding.
Do you mean making the binding of the uniform be 2? the error remains
Hm, looks like descriptor arrays are actually not supported via Godot’s RenderingDevice.
You can work around by merging all 10 buffers into a single big buffer, or just bind individually.
combining them was what i was trying to avoid
fetching the data from the GPU is slow. That’s such a shame. I’m confused why it isn’t, i looked in the source code of godot and you do have multiple the ability to bind multiple IDs to a uniform
so now i’m wondering why if not for that
Maybe i could get a little bit of C++ in there, but i have never C++ in the context of godot, i don’t know how smooth it’d integrate given my whole project is with gdscript
Yeah, I don’t know what’s the current use of multiple id’s but they are apparently not interpreted as a descriptor array.
A C++ intervention would likely require doing some Vulkan and/or D3D12 code. If you’re comfortable with that - go for it.
Maybe bring this question to attention of the rendering team. There still could be some undocumented way to do it from script.
how would i do that / where would i find them to chat? I don’t know who that would be 
I’d just spam @clayjohn or @Calinou with a short direct question if it’s possible to bind a descriptor array.
Or go to proposal discussions and demand the feature. If it somehow already exists, someone will likely tell you 
i will do, thank you! i’ll mark the post as solved once i get an answer from either him or after having made a proposal
1 Like
@normalized Suggesting someone spam contributors to help them is not okay. We already give you enough of our free time contributing to the project. We are not your on-call support people.
Further, pinging me here was enough. Its fine to ping me and see if I’ll respond. Telling someone to message me on my personal email and demand an answer is utterly disrespectful and a huge violation. It also guarantees that there is zero chance I will be spending my free time assisting either one of you.
Sorry about that. I was half joking, presuming the OP will act in a tactful manner. I’ll remove the post if it inconveniences you. I thought pointing at github handles of team members doesn’t cross any lines. They are publicly available in the contributing documentation as well as in engine’s about window.
Could you still give a brief yes/no answer whether descriptor array binding is at all doable via RenderingDevice? It’d be much appreciated.
I apologize. I’m new to the community/forum so i didn’t realize you got pinged already. I didn’t think a direct mail was too forward, and hope it didn’t come across as disrespectful. I understand if you’re not keen on helping and i hope the rest of your day goes well!
Thanks for contributing to godot it’s awesome, huge respect!