-
Notifications
You must be signed in to change notification settings - Fork 81
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
opengl can't compile the shader #45
Comments
I think this is due to the fact that the read_entire_file does not zero out the remaining space if for instance you load a shader of 100 bytes and after that a shader of 90 bytes the last 10 bytes will still be of the old shader. The count in the SB will be correctly set to 90, but only the .items pointer is passed to the compile_shader function Line 55 in 983c711
which apparently does not take into account null terminators halfway in the chararray. So memsetting the full SB to 0 before reading the file helps Line 105 in 983c711
Note there is a PR with a working windows build (both local and CI) if you're interested #42 |
|
Are you trying to run the build_msvc file or the ded.exe? The ded.exe needs the SDL2.dll and freetype.dll and it's the 64 bit version that is build maybe that's the issue. Could you try to run from the commandline to see if there is some extra logging? |
Weird indeed, the good news is it builds 👍 Maybe this will have some guidance? https://www.passfab.com/windows-10/this-app-cant-run-on-your-pc.html |
I am having the same issue as OP. I tried memset(sb, 0, size) before line 105 but I just get a crash. C isn't really my strength. Any thoughts on how to fix the shader compile error or am I just memsetting wrong? |
Hi maybe you memset to early? I have it on line 109 and that seems to work |
That made it start working for me. I was memsetting the entire var, not just the items. Thanks! |
GL version 3.3
GL CALLBACK: type = 0x8251, severity = 0x826b, message = Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
ERROR: could not compile GL_VERTEX_SHADER
0(28) : error C0000: syntax error, unexpected $undefined at token ""
ERROR: failed to compile
./shaders/free_glyph.vert
shader fileThe text was updated successfully, but these errors were encountered: