-
-
Notifications
You must be signed in to change notification settings - Fork 45
Draw to texture fix #401
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
Draw to texture fix #401
Conversation
Closes RandyGaul#286
This extra commit ensures that the demos work on macOS Same error as in RandyGaul#286
|
Seems like we should perhaps merge draw elements and commit together. Historically commit came from copying sokol_gfx's API design and just mirroring it 1:1 without much independent design consideration. I rather like @bullno1's suggestion:
Putting a little more thought into it, commit at this time is acting like "I'm done with this pass" which not what it did in sokol_gfx. In CF we have: void cf_sdlgpu_commit()
{
SDL_EndGPURenderPass(g_ctx.canvas->pass);
}I do agree the weirdness seems to be draw elements is separated from mesh. Though, in the case of static meshes it is entirely possible to want to apply a mesh once and then swap textures or maybe even shaders for different instances, but, perhaps that's just not worth an entire other API call. From sokol_gfx API In CF the "end of frame" that a My tentative rec (would appreciate comments from others):
Thoughts? |
|
So it would be in summary comment form in cute_graphics.h |
|
Sounds good, majority (maybe all?) of cases you have a mesh to pass in anyways so cutting off a couple lines makes this less error prone. |
This change inlines cf_commit into cf_draw_elements so that it does not need to be called separately.
|
@RandyGaul The nixing of the |
* Commit in blit Closes RandyGaul#286 * Fix shatter samples This extra commit ensures that the demos work on macOS Same error as in RandyGaul#286 * Inline cf_commit This change inlines cf_commit into cf_draw_elements so that it does not need to be called separately. * Update docs after cf_commit removal
This is the attempt to fix the issues with the samples on macOS.
I saw that in the
s_draw_report, after callingcf_draw_elements(), we also callcf_commit(). Following that approach in thes_blit()makes thedraw_to_texturework:Opening this as draft, as I'm not sure this is the correct way to fix this problem, and I'm not sure what the implications are.
Additionally, the other shatter demos have the same issue. I wonder if
cf_commit()should be part ofcf_draw_elements()?