-
Notifications
You must be signed in to change notification settings - Fork 63
Implement PushBuffer #1684
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
base: master
Are you sure you want to change the base?
Implement PushBuffer #1684
Conversation
1e2423c
to
1bd0d74
Compare
This can be rebased now. |
1bd0d74
to
1b41cd4
Compare
Done. |
Some issues found with testing:
|
Now I found a way. Set |
} | ||
|
||
if ( _shader->UseMaterialSystem() && !_global ) { | ||
if ( ( _shader->UseMaterialSystem() && _updateType == MATERIAL_OR_PUSH ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helper function for this? It's a cryptic and unwieldy expression to have to repeat so many times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworked that part in #1685, it makes the whole uniform caching part much more straightforward.
4b840fd
to
3e2071b
Compare
Fixed. |
Also fixed. |
I confirm the 2 previous bugs are fixed. But I get the depth fade issue from #1676 again with this branch when enabling material system. It happens with any depth fade regardless of alpha tests, polygon offset etc. The bug reappears as of the first usable commit |
The comment there says it was already broken on material system? On my end it was working fine so I can't confirm if there's any issue with it on master right now. |
It was broken but #1704 fixed it. It works on master. |
Not sure what the issue is. I can't reproduce it on my end, and there don't seem to be any depth writes after |
The depth texture is all garbage all the time, as if it's not hooked up properly. It's still garbage if I set By the way, I realized you can make a depth texture visualization with just a q3shader, no GLSL required:
|
Hmm, the only thing I could think of is it has something to do with the textures being bindless. This is on AMD + Mesa, right? It might have the same cause as the broken occlusion culling reported there ~1 year ago. |
Yes
On master if I turn on occlusion culling, it segfaults immediately. |
Is the segfault coming from daemon? I don't get any on master. |
I have provided a stack trace in #1724 |
That's true, just |
Even with the fix from #1725? |
Nevermind, if material system isn't enabled #1725 will have no effect. |
Anyway, I think it's just a driver bug. |
025efe7
to
e0bf785
Compare
e0bf785
to
93e3e66
Compare
Adds `PushBuffer` class, `pushBuffer` global, and the supporting code for `glconfig2`.
Also adds `GLShader.pushSkip` and `GLShader._pushUniforms`. Add `padding` back to the `GLShader` size calculations in material system.
Will be required for `PushBuffer` to set global uniform values outside of their shaders.
This will set `GLShaderManager.globalUniformBlock` to the struct + defines text, which will be the same for all shaders.
This will be required for `PushBuffer` to correctly sort uniforms. Also updates `GLShader.WriteUniformsToBuffer()` to use `mode` and `filter` arguments to select the correct uniforms.
Post-process shaders to actually add the `globalUniformBlock`, add `SetConstUniforms()` and `SetFrameUniforms()` functions to the core and material system renderers, and add the supporting glsl code.
93e3e66
to
310ed75
Compare
Requires #1683
Add
PushBuffer
, update uniforms to have anupdateType
. TheCONST
andFRAME
uniforms are written into a uniform buffer after the map is loaded/at the start of a frame. This allows skipping some of theglUniform*()
calls to decrease the amount of overhead.This largely re-uses the existing functionality added for the material system.
This will also be needed for #1587