-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Failure to compile effect #23
Comments
Put a breakpoint in the DebugCallback and it'll tell you which call it was. |
It also looks like your drivers are out of date: |
Good shout, it produces the error during the call to MOJOSHADER_glCompileEffect. I agree the drivers may be out of date on this laptop, but I got the same issue on my work machine running up to date nvidea drivers. |
If you've also got the latest fnalibs and you're still getting this then you'll have to step through this: https://github.com/flibitijibibo/MojoShader/blob/master/mojoshader_opengl.c#L416 The likelihood of an actual INVALID_ENUM is extremely unlikely, as it would have to be glCreateShader getting sent GL_NONE, which is only true if you're attempting to send a shader other than vertex/pixel, which wouldn't make it past the parsing process. |
I am using the latest fnalibs, Ill step through that code first thing and post what I find. Thanks for your help. |
After stepping through the failure occurs in mojoshader.c 2723: it was caused by an effect file which passed a color between the Vertex shader, and Pixel shader using COLOR2. I'm not sure if by using that channel if I am violating the usage of the COLOR2 semantic, but the problem is fixed by passing a float4 using a TEXCOORD semantic. |
I believe I fixed this with the latest MojoShader commit, can you try it out? |
I just tried your latest commit, and that fixes the unknown variable issue. Thank you! What do you think about trying to get access to the fail reasons which are written too during processing and trying to expose them to the FNA logger? even if it is only during debug sessions. May make diagnostics easier in future, which in my case testing on windows involved a lot of printf statements. |
Error checking for the effects has been a very overdue fix, so I'd be up for that. Just add it to this method using FNAPlatform.Log and I'll pull it in (check your tabs carefully! ;P ). https://github.com/FNA-XNA/FNA/blob/master/src/Graphics/OpenGLDevice.cs#L1750 |
So I have written at least logging errors for parsing of effects, however it also uses Utf8 to managed string marshaling like that which exists in SDL2# LPUtf8StrMarshaler, and which is also used in SDL2_FnaPlatform. Do you have a place for sticking a convenience method such as:
which could be used at least initially in OpenGLDevice#CreateEffect ? |
At the moment no, but I wouldn't mind if you just copied this into that function: https://github.com/FNA-XNA/FNA/blob/master/src/SDL2/SDL2_FNAPlatform.cs#L395 |
This will be fixed with the next fnalibs update, pending #24's fixes. |
Hi,
I have upgraded to the latest 16.5.5 version and I am getting the following errors occurring when attempting to load an effect file:
I presume something is going wrong in the native mojoshader code. Has anyone seen anything like this before? or else I will be stepping through mojoshader :)
The text was updated successfully, but these errors were encountered: