-
Notifications
You must be signed in to change notification settings - Fork 60
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
Some material system fixes and cleanup #1416
Conversation
Fix `fogSurface` index and material SSBO offset.
633f379
to
c977287
Compare
|
||
// Make sure padding is taken into account for dynamicDrawSurfsOffset | ||
if ( !dynamicDrawSurfOffsetSet ) { | ||
dynamicDrawSurfsOffset = offset; |
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 this variable needs to point to the end of the first material? That seems weird.
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.
To the start of the first dynamic material, rather. Since the buffer is structured like this:
staticMaterial_0
...
staticMaterial_last
padding
dynamicMaterial_0
...
Padding after material n
depends on the material n + 1
, and is added at the offset += padding;
line (last dynamic material never has any padding after it). dynamicDrawSurfsOffset
is then used as the start of the range when mapping the buffer to update it, so it has to point to the index directly after the last static material padding.
c977287
to
e94ef0c
Compare
LGTM |
Fixes a material system crash where the first dynamic surface shader has a non-0 padding.
Fixes incorrect drawSurf index being returned by
R_AddDrawSurf()
.Made
u_DepthMap
andu_PortalMap
into global uniforms, and cleaned up some of the material system code.