Fragment shader fails to compile: undeclared identifier 'vec4_splat' #3408
Unanswered
justcoredev
asked this question in
Q&A
Replies: 2 comments 4 replies
|
You forgot to include header that has definition of |
4 replies
|
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! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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.scAnd 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.scShader sources:
vs_test.scfs_test.scvarying.def.scI'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.
All reactions