Open teamclouday opened 1 year ago
Is there a way to initialize a
RDShaderSPIRV
from byte array? If so, it may be possible to write a custom plugin for this.
For the custom plug-in, check EditorImportPlugin and the corresponding tutorial.
I can't judge whether this should be part of the engine core though.
Thank you! Yes you are right, an import plugin should work.\ I just wrote a SPIRV-Importer and have submitted to the asset library.
Not sure if it would be part of the engine core either. Just thought it might give users flexible options to use shaders.
I think it should be part of core personally - it's an easy way for people to use multiple shading languages with a compiler like Slang.
I would also like to add that RDShaderSPIRV should expose reflection data, e.g. from https://github.com/KhronosGroup/SPIRV-Cross
This would allow using shader resources in a node graph, would allow error checking for missing resources etc. BEFORE submitting the shader to the pipeline, etc.
Describe the project you are working on
I'm working on a toy path tracer project using glsl compute shaders.
Describe the problem or limitation you are having in your project
I have multiple header files and need to import with
#include
. Currently godot's built-in glsl shader compiler doesn't resolve include paths with depth > 1. See https://github.com/godotengine/godot/issues/80532 for more details.So I would like to compile manually and import the binary
.spv
file into godot.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Would be great if the engine can recognize
*.spv
files and import asRDShaderSPIRV
or similar resources.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Once godot detect the file in project, it imports the file into the engine.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not sure. I'm new to godot. Is there a way to initialize a
RDShaderSPIRV
from byte array? If so, it may be possible to write a custom plugin for this.Is there a reason why this should be core and not an add-on in the asset library?
If the built-in shader compiler isn't up to date with the latest
glslc
implementations, the engine should make it possible to use shader resources compiled outside of the engine.