I am using Slang to create compute shaders for use in Godot. In Godot, the shader source code must include the #[compute] directive at the top of the file.
I attempted to achieve this by adding the following line to the computeMain function.
__requirePrelude(R"(#[compute])");
However, compilation to GLSL fails with the following error:
internal error 99999: unimplemented feature in Slang compiler: unexpected IR opcode during code emit
__requirePrelude(R"(#[compute])");
Question
Is it possible to support the addition of custom GLSL code (e.g., directives like #[compute]) in Slang shaders? If not, are there any alternative approaches or workarounds for embedding such directives in the generated GLSL code for compatibility with Godot?
Steps to Reproduce
Use Slang to create a compute shader.
Add __requirePrelude(R"(#[compute])"); inside the compute function.
Compile the shader to GLSL using the Slang compiler.
Expected Behavior
The #[compute] directive should be successfully added to the GLSL output for compatibility with Godot.
Description
I am using Slang to create compute shaders for use in Godot. In Godot, the shader source code must include the
#[compute]
directive at the top of the file.I attempted to achieve this by adding the following line to the computeMain function.
However, compilation to GLSL fails with the following error:
Question
Is it possible to support the addition of custom GLSL code (e.g., directives like
#[compute]
) in Slang shaders? If not, are there any alternative approaches or workarounds for embedding such directives in the generated GLSL code for compatibility with Godot?Steps to Reproduce
__requirePrelude(R"(#[compute])");
inside the compute function.Expected Behavior
The
#[compute]
directive should be successfully added to the GLSL output for compatibility with Godot.Actual Behavior
The compilation fails with an internal error.