-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix glsl_restart with material system #1507
Conversation
0d00485
to
e639ae3
Compare
fddf9d2
to
275e96b
Compare
Made it just reset shaders rather than rebuild all materials, and rebased on master. |
275e96b
to
d5c50ec
Compare
Appveyor failed becuase of some appveyor or github error:
|
Yeah, AppVeyor is having trouble to connect to GitHub right now, I restarted the build 4 times before getting it finished, and I faced similar issues at different times like that:
|
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 make the drawSurf_t
copying hack less likely to go awry, I propose zeroing its pointer members which may be invalidated, of type trRefEntity_t *
and drawSurf_t *
. That way we will get a clean crash if one of them ends up being used.
@@ -85,6 +85,10 @@ struct Material { | |||
GLuint program = 0; | |||
GLShader* shader; | |||
|
|||
// Used only for glsl_restart | |||
shaderStage_t* refStage; | |||
drawSurf_t refDrawSurf; |
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.
What does "ref" mean?
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.
Reference.
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.
refDrawSurf
isn't a reference though.
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.
Well, as in "reference to the values used for this material". Might not be a good name for it.
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.
Something like original[DrawSurf/Stage]
might be better.
14dc0d3
to
5e12a8c
Compare
Good point, done now. |
5e12a8c
to
3706949
Compare
LGTM |
Fixes
glsl_restart
with material system by resetting the shaders for each material.