Giter Site home page Giter Site logo

Road to v1.0 about sokol HOT 7 CLOSED

floooh avatar floooh commented on August 17, 2024
Road to v1.0

from sokol.

Comments (7)

sherjilozair avatar sherjilozair commented on August 17, 2024 1

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.

sherjilozair avatar sherjilozair commented on August 17, 2024 1

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.

floooh avatar floooh commented on August 17, 2024 1

Ok, I'll check if I can somehow improve error reporting for this case. In any case, thanks for the feedback :)

from sokol.

floooh avatar floooh commented on August 17, 2024

...this is how ANGLE handles depth bias: https://github.com/google/angle/blob/8c5b69cbaa1084d42d2fd68e2781a78bd6dc6015/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp#L177

from sokol.

sherjilozair avatar sherjilozair commented on August 17, 2024

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.

floooh avatar floooh commented on August 17, 2024

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:

sokol/sokol_gfx.h

Line 7742 in 1a7d148

_SOKOL_PRIVATE const char* _sg_validate_string(_sg_validate_error err) {
)

from sokol.

floooh avatar floooh commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.