mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
glgsg: Fix stencil renderbuffer not being unbound when binding depth tex
Fixes part of #1364
This commit is contained in:
parent
d4b8bb63ba
commit
c799146cc9
@ -788,6 +788,13 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
|
||||
GLCAT.debug() << "Binding texture " << *tex << " to depth attachment.\n";
|
||||
}
|
||||
|
||||
if (slot != RTP_depth_stencil && _rb[RTP_depth_stencil] != 0) {
|
||||
// We have a depth-stencil renderbuffer bound, delete it first.
|
||||
// This will automatically unbind it as well.
|
||||
glgsg->_glDeleteRenderbuffers(1, &(_rb[RTP_depth_stencil]));
|
||||
_rb[RTP_depth_stencil] = 0;
|
||||
}
|
||||
|
||||
attach_tex(layer, 0, tex, GL_DEPTH_ATTACHMENT_EXT);
|
||||
|
||||
#ifndef OPENGLES
|
||||
|
Loading…
x
Reference in New Issue
Block a user