mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Fixed an end_scene related bug (failure to clean up shader data)
This commit is contained in:
parent
be97920b58
commit
4814634f95
@ -1093,6 +1093,22 @@ void DXGraphicsStateGuardian9::
|
||||
end_scene() {
|
||||
GraphicsStateGuardian::end_scene();
|
||||
|
||||
if (_vertex_array_shader_context != 0) {
|
||||
_vertex_array_shader_context->disable_shader_vertex_arrays(this);
|
||||
_vertex_array_shader = (Shader *)NULL;
|
||||
_vertex_array_shader_context = (CLP(ShaderContext) *)NULL;
|
||||
}
|
||||
if (_texture_binding_shader_context != 0) {
|
||||
_texture_binding_shader_context->disable_shader_texture_bindings(this);
|
||||
_texture_binding_shader = (Shader *)NULL;
|
||||
_texture_binding_shader_context = (CLP(ShaderContext) *)NULL;
|
||||
}
|
||||
if (_current_shader_context != 0) {
|
||||
_current_shader_context->unbind(this);
|
||||
_current_shader = (Shader *)NULL;
|
||||
_current_shader_context = (CLP(ShaderContext) *)NULL;
|
||||
}
|
||||
|
||||
DBG_S dxgsg9_cat.debug ( ) << "DXGraphicsStateGuardian9::end_scene\n"; DBG_E
|
||||
|
||||
/*
|
||||
|
@ -1414,6 +1414,56 @@ begin_frame(Thread *current_thread) {
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::begin_scene
|
||||
// Access: Public, Virtual
|
||||
// Description: Called between begin_frame() and end_frame() to mark
|
||||
// the beginning of drawing commands for a "scene"
|
||||
// (usually a particular DisplayRegion) within a frame.
|
||||
// All 3-D drawing commands, except the clear operation,
|
||||
// must be enclosed within begin_scene() .. end_scene().
|
||||
//
|
||||
// The return value is true if successful (in which case
|
||||
// the scene will be drawn and end_scene() will be
|
||||
// called later), or false if unsuccessful (in which
|
||||
// case nothing will be drawn and end_scene() will not
|
||||
// be called).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool CLP(GraphicsStateGuardian)::
|
||||
begin_scene() {
|
||||
return GraphicsStateGuardian::begin_scene();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GLGraphicsStateGuardian::end_scene
|
||||
// Access: Protected, Virtual
|
||||
// Description: Called between begin_frame() and end_frame() to mark
|
||||
// the end of drawing commands for a "scene" (usually a
|
||||
// particular DisplayRegion) within a frame. All 3-D
|
||||
// drawing commands, except the clear operation, must be
|
||||
// enclosed within begin_scene() .. end_scene().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
end_scene() {
|
||||
GraphicsStateGuardian::end_scene();
|
||||
|
||||
if (_vertex_array_shader_context != 0) {
|
||||
_vertex_array_shader_context->disable_shader_vertex_arrays(this);
|
||||
_vertex_array_shader = (Shader *)NULL;
|
||||
_vertex_array_shader_context = (CLP(ShaderContext) *)NULL;
|
||||
}
|
||||
if (_texture_binding_shader_context != 0) {
|
||||
_texture_binding_shader_context->disable_shader_texture_bindings(this);
|
||||
_texture_binding_shader = (Shader *)NULL;
|
||||
_texture_binding_shader_context = (CLP(ShaderContext) *)NULL;
|
||||
}
|
||||
if (_current_shader_context != 0) {
|
||||
_current_shader_context->unbind();
|
||||
_current_shader = (Shader *)NULL;
|
||||
_current_shader_context = (CLP(ShaderContext) *)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GLGraphicsStateGuardian::end_frame
|
||||
// Access: Public, Virtual
|
||||
|
@ -124,6 +124,8 @@ public:
|
||||
virtual bool prepare_lens();
|
||||
|
||||
virtual bool begin_frame(Thread *current_thread);
|
||||
virtual bool begin_scene();
|
||||
virtual void end_scene();
|
||||
virtual void end_frame(Thread *current_thread);
|
||||
|
||||
virtual bool begin_draw_primitives(const GeomPipelineReader *geom_reader,
|
||||
|
Loading…
x
Reference in New Issue
Block a user