Fragment shader fails to compile: undeclared identifier 'vec4_splat' #3408
Replies: 2 comments 4 replies
-
You forgot to include header that has definition of |
Beta Was this translation helpful? Give feedback.
-
I think you can read my project Tina I am also a newbie to Bgfx. I have been in contact with this for a long time, but I can only use it simply! You can read the cmake/modules/ShaderUtils.cmake in my renderer/refactor branch. This cmake contains a simple example of how to compile 2d_fs.sc, 2d_vs.sc into a bin file! I also learned that it can be so simple to encapsulate by looking at other people's projects! And there are also simple examples in the bgfx example directory that can be used for learning! |
Beta Was this translation helpful? Give feedback.
-
I'm trying to compile a set of simple pass-through shaders using shadercDebug.exe, but while the vertex shader compiles without complaints, the fragment shader fails with the following error:
For the vertex shader, I used this command:
shadercDebug.exe -f shaders/vs_test.sc -o shaders/vs_test.bin --type vertex --platform windows -p s_5_0 --varying shaders/varying.def.sc
And for the fragment shader:
shadercDebug.exe -f shaders/fs_test.sc -o shaders/fs_test.bin --type fragment --platform windows -p s_5_0 --varying shaders/varying.def.sc
Shader sources:
vs_test.sc
fs_test.sc
varying.def.sc
I've tried switching from s_5_0 to different profiles (such as s_4_0 and 150), but the error remains the same.
I'm new to bgfx, so I'm puzzled by this error. Specifically, why is vec4_splat not recognized during the fragment shader compilation? Is it supposed to be provided by the shader compiler, or do I need to define it myself somewhere in my code?
Any guidance or suggestions to resolve this issue would be greatly appreciated!
Thanks in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions