Comments (7)
Having invalid shader code or valid shader code but wrong types for uniform gives me this assert: Assertion failed: (shd && shd->slot.state == SG_RESOURCESTATE_VALID), function sg_init_pipeline, file ./sokol/sokol_gfx.h, line 8520.
There also needs to be error checking at the end of _sg_apply_uniform_block
, and _sg_draw
. glUniformMatrix4fv
failed for me, but I got an error in sg_end_pass
because that's where the next _SG_GL_CHECK_ERROR
was.
from sokol.
I think I was mistaken when I said I get the error for invalid shader code. I didn't check for that. But I did get the assert when using wrong types for uniform.
Try wrong types for uniform variables, i.e. have vec4
in shader code, but specify SG_UNIFORMTYPE_MAT4
to sokol, for a uniform.
from sokol.
Ok, I'll check if I can somehow improve error reporting for this case. In any case, thanks for the feedback :)
from sokol.
...this is how ANGLE handles depth bias: https://github.com/google/angle/blob/8c5b69cbaa1084d42d2fd68e2781a78bd6dc6015/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp#L177
from sokol.
Sokol could use improved error reporting. Right now, I just get an uninformative assert failure, and have to dig into the code to figure out what failed. A function which converts backend error codes to strings would be useful.
from sokol.
What assert where you hitting? The idea is that you should get a validation error message when the API is used incorrectly, but there are places where validations don't happen yet. But if there are 'popular asserts' then there should be a validation check in front, which would result in a human readable error message (like these:
Line 7742 in 1a7d148
from sokol.
hmm, currently looking into the shader compilation problem, and I'm getting a validation layer error, not the assertion later in sg_init_pipeline():
ERROR: 0:7: Use of undeclared identifier 'gl_Pxxxosition'
sg_pipeline_desc.shader missing or invalid
^^^^ VALIDATION FAILED, TERMINATING ^^^^
Assertion failed: (0), function _sg_validate_end, file /Users/floh/projects/sokol/sokol_gfx.h, line 7876.
Did you override any of the SOKOL_VALIDATE_xxx() macros by chance?
from sokol.
Related Issues (20)
- GL Shader compilation error not shown if OpenGL doesn't provide an error log
- sokol_app.h: fix scroll event values (WHEEL_DELTA vs 30.0f) HOT 1
- Remove SG_FILTER_NONE
- D3D11 backend: allow injected textures to not have a shader-resource-view.
- Add backend-specific resource info functions.
- What is the recommended version that still supports GLES2? HOT 1
- stale default framebuffer bound at end of offscreen pass HOT 5
- sokol_gfx: Issue creating render target HOT 17
- GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl) HOT 3
- sokol_gfx_imgui.h depends on sokol_app.h ? HOT 4
- Compiling into a DLL with cimgui/sokol_imgui included HOT 12
- Crash in multithreaded code HOT 1
- Expose _sg_pixelformat_bytesize to users? HOT 4
- sokol_gfx: Validation error when creating offscreen pass. HOT 2
- Suggestion: Show labels in validation errors HOT 2
- Android builds without fips? HOT 4
- Help: Sampler type on per-texture basis HOT 2
- sokol-samples : `fips build` error HOT 4
- sokol_nuklear.h: how to know if nuklear handled an event HOT 3
- const void *sapp_metal_get_device(void): Assertion `_sapp.valid' failed.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sokol.