mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
More shader fixes
This commit is contained in:
parent
844a822aea
commit
c9c680a50f
@ -2588,6 +2588,15 @@ issue_shade_model(const ShadeModelAttrib *attrib) {
|
|||||||
void CLP(GraphicsStateGuardian)::
|
void CLP(GraphicsStateGuardian)::
|
||||||
issue_shader(const ShaderAttrib *attrib) {
|
issue_shader(const ShaderAttrib *attrib) {
|
||||||
ShaderMode *mode = attrib->get_shader_mode();
|
ShaderMode *mode = attrib->get_shader_mode();
|
||||||
|
if (mode == 0) {
|
||||||
|
if (_shader_context != 0) {
|
||||||
|
_shader_context->unbind();
|
||||||
|
_shader_context = 0;
|
||||||
|
_shader_mode = 0;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Shader *shader = mode->get_shader();
|
Shader *shader = mode->get_shader();
|
||||||
CLP(ShaderContext) *context = (CLP(ShaderContext) *)(shader->prepare_now(get_prepared_objects(), this));
|
CLP(ShaderContext) *context = (CLP(ShaderContext) *)(shader->prepare_now(get_prepared_objects(), this));
|
||||||
|
|
||||||
@ -2602,9 +2611,11 @@ issue_shader(const ShaderAttrib *attrib) {
|
|||||||
context->bind(mode);
|
context->bind(mode);
|
||||||
_shader_context = context;
|
_shader_context = context;
|
||||||
}
|
}
|
||||||
|
_shader_mode = mode;
|
||||||
} else {
|
} else {
|
||||||
// Use the same shader as before, but with new input arguments.
|
// Use the same shader as before, but with new input arguments.
|
||||||
context->rebind(_shader_mode, mode);
|
context->rebind(_shader_mode, mode);
|
||||||
|
_shader_mode = mode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,11 +20,10 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: ShaderAttrib::Constructor
|
// Function: ShaderAttrib::Constructor
|
||||||
// Access: Private
|
// Access: Private
|
||||||
// Description: Use ShaderAttrib::make() to construct a new
|
// Description: xyz
|
||||||
// ShaderAttrib object.
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE ShaderAttrib::
|
INLINE ShaderAttrib::
|
||||||
ShaderAttrib() {
|
ShaderAttrib(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
class EXPCL_PANDA ShaderAttrib: public RenderAttrib {
|
class EXPCL_PANDA ShaderAttrib: public RenderAttrib {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
INLINE ShaderAttrib();
|
INLINE ShaderAttrib(void);
|
||||||
|
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
static CPT(RenderAttrib) make(ShaderMode *sm);
|
static CPT(RenderAttrib) make(ShaderMode *sm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user