Skip to content
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

Road to v1.0 #24

Closed
12 of 14 tasks
floooh opened this issue Oct 22, 2017 · 7 comments
Closed
12 of 14 tasks

Road to v1.0 #24

floooh opened this issue Oct 22, 2017 · 7 comments
Assignees
Labels

Comments

@floooh
Copy link
Owner

floooh commented Oct 22, 2017

  • validation for sg_update_buffer()
  • validation for sg_update_image()
  • WebGL2->WebGL fallback
  • 10-10-10-2 vertex format inconsistency (D3D11 only has unsigned format)
  • remove scissor_test_enabled, must be always enabled (Metal doesn't have that)
  • reset scissor rect to full render target size at start of pass
  • depth-bias stuff, need to check if there's a common ground for GL, D3D11, Metal
  • depth_clip_enabled(?) not supported by GLES2/WebGL or GLES3/WebGL2
  • antialiased_line_enabled(?) not supported on Metal, and with many caveats on D3D11
  • max_anisotropy (sampler state, so needs to go into sg_image_desc)
  • sampler state min_lod, max_lod, mip_lod_bias(?) mip_lod_bias as render state is only in D3D11, min_lod/max_lod is not in GLES2/WebGL (just ignore it there)
  • allow use of externally created "native" D3D11, GL and Metal buffer and image resources
  • Metal samples for iOS

OPTIONAL:

  • RaspberryPi2 samples
@floooh
Copy link
Owner Author

floooh commented Nov 15, 2017

@sherjilozair
Copy link

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.

@floooh
Copy link
Owner Author

floooh commented Jun 18, 2018

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) {
)

@sherjilozair
Copy link

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.

@floooh
Copy link
Owner Author

floooh commented Jun 21, 2018

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?

@sherjilozair
Copy link

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.

@floooh
Copy link
Owner Author

floooh commented Jun 22, 2018

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

@floooh floooh closed this as completed Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants