-
Notifications
You must be signed in to change notification settings - Fork 69
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
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 |
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? |
64f48dd to
03de480
Compare
Fixed. |
|
I've removed the previous workaround commit since it's not working. |
03de480 to
43f10c2
Compare
|
I've got confirmation that it works fine on AMD proprietary with |
|
Besides the depth fade issues on AMD + Mesa, I get a couple problems with the current branch:
The |
43f10c2 to
8a795cc
Compare
First issue fixed, but I'm not reproducing the second one on NV. If it still happens and |
|
It has the same issue as #1480 where screenshots apparently read from the wrong framebuffer. |
|
I see. That is therefore not really relevant to the pr. |
|
How is it not relevant? Screenshots work correctly in master but don't work in this PR. |
I cannot reproduce that, the issue must be with whatever setup was used for testing. |
|
Hmm, the screenshot wrong framebuffer bug seems to be vendor-specific in this PushBuffer PR. I get it with AMD+Linux but not Nvidia+Windows. Unlike #1480 where I get it with both. |
Perhaps it's something similar to the read-only depth buffer issue, but for colour render targets. |
|
I wrote some code, available on the #1882 should fix the issue for this PR, which turned out to be a bug with read-only depth buffers. Wrong screenshots on #1480 must have some other cause. |
86dbf0e to
26290ec
Compare
|
That'd work, thx. |
Adds `PushBuffer` class, `pushBuffer` global, and the supporting code for `glconfig2`.
- Generalise uniform post-processing - Add `GLShader.pushSkip` and `GLShader._pushUniforms`. Add `padding` back to the `GLShader` size calculations in material system. - Add GlobalUBOProxy, required for `PushBuffer` to set global uniform values outside of their shaders. - Add `PostProcessGlobalUniforms()`: set `GLShaderManager.globalUniformBlock` to the struct + defines text, which will be the same for all shaders. - GLUniform._global -> _updateType: required for `PushBuffer` to correctly sort uniforms. Also updates `GLShader.WriteUniformsToBuffer()` to use `mode` and `filter` arguments to select the correct uniforms. - Add global UBO in PushBuffer - 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. - Fix quake3 fog with material system
26290ec to
88ac29b
Compare
slipher
left a comment
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.
So now the MATERIAL_OR_PUSH argument just has to be added to the test uniform constructors for it to compile.
LGTM modulo comments
88ac29b to
f8be64a
Compare

Requires #1683
Add
PushBuffer, update uniforms to have anupdateType. TheCONSTandFRAMEuniforms 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