Closed thargor6 closed 1 month ago
It seems you don't need to add the mark #[compute]
for your shader code in gdscript.
I removed this mark from your project, and it works well.
Maybe this mark only works for raw glsl file, I guess?
Indeed, this works! Awesome, thanks a bunch! :-) Even if this resolves the problem completely for me, I will keep the issue open. Maybe the Godot team wants to add some hint to the docs or add some warning message somewhere.
There is some error in debugger, just not very helpful
Checking the code, it looks like shader_compile_spirv_from_source
is called after strip all the stage info
Tested versions
System information
macOS Sonoma - Godot 4.3 stable - Vulkan (Forward+) - Apple M1 Max
Issue description
I'm working on project which needs to modify or create compute shader code. Here I mean not shader parameters, but whole functions (It would be impossible to include all possible combinations, these are affected by the users input).
So, I'm trying to use the RDShaderSource together with the with RenderingDevice::shader_compile_spirv_from_source to compile a compute shader during runtime. But this yields to a RID(0) when I then call RenderingDevice::shader_create_from_spirv
The only thing which works is to load/preload the shader code from the res:// folder. I also tried to load it from the user:// folder (using ResourceLoader::load), but this also does not work.
Steps to reproduce
Minimal reproduction project (MRP)
Mandelbrot.zip