Replies: 4 comments 2 replies
|
See how bgfx/examples/common/bgfx_utils.cpp Lines 643 to 644 in c3d55ba |
|
Interesting. I sometimes set uniforms at the top of my render procedure that all of the draw calls use even though I have the default BGFX_DISCARD_ALL. Is it a bug or undefined behavior that I don't have to set them again for every call? Also is there a way to tell BGFX to discard all state without explicitly doing a call? I don't always know whether I'm currently sending the last call in a group. |
You're just using stale uniforms, and if it appears correct is just ordering of draw calls, but it's not guaranteed to be correct. API is completely stateless so you need to submit everything related to draw call. |
|
Reading renderer_gl.cpp I am realizing that flag clears any previous state before beginning processing the next call, rather than clearing any state left over from this call at the end. Is that correct? So for example it works like this: And not this: Is that correct? |
Uh oh!
There was an error while loading. Please reload this page.
When my code looks like this everything works fine:
However if I reorder things a bit to try to save on redundant calls then I get rendering issues
If I look at this in RenderDoc, bgfx is not updating the texture and uniforms at all in the views later in the list, so it gets whatever happened to be last rendered for that view.
Are you supposed to be required to re-submit this information for every view? I thought internally everything you have previously submitted gets buffered and re-submitted when you submit the next item regardless of what view it's in.
All reactions