Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Custom GLSL Code in Slang #5687

Closed
Calonca opened this issue Nov 26, 2024 · 1 comment · Fixed by #5735
Closed

Support for Custom GLSL Code in Slang #5687

Calonca opened this issue Nov 26, 2024 · 1 comment · Fixed by #5735
Assignees
Labels
goal:client support Feature or fix needed for a current slang user.

Comments

@Calonca
Copy link

Calonca commented Nov 26, 2024

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.

__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

  1. Use Slang to create a compute shader.
  2. Add __requirePrelude(R"(#[compute])"); inside the compute function.
  3. 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.

Actual Behavior

The compilation fails with an internal error.

@jkwak-work
Copy link
Collaborator

This question was initially brought up on Discord.
Yong agreed to support it.

@bmillsNV bmillsNV added this to the Q4 2024 (Fall) milestone Dec 2, 2024
@bmillsNV bmillsNV added the goal:client support Feature or fix needed for a current slang user. label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:client support Feature or fix needed for a current slang user.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants