glgsg: Fix use after free with gl-force-fbo-color and layered FBO
This commit is contained in:
parent
26dd784153
commit
6f33bbecea
|
|
@ -419,6 +419,7 @@ rebuild_bitplanes() {
|
|||
Texture *attach[RTP_COUNT];
|
||||
memset(attach, 0, sizeof(Texture *) * RTP_COUNT);
|
||||
_texture_contexts.clear();
|
||||
_textures.clear();
|
||||
|
||||
// Sort the textures list into appropriate slots.
|
||||
{
|
||||
|
|
@ -793,6 +794,8 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
|
|||
_fb_properties.setup_color_texture(tex);
|
||||
}
|
||||
|
||||
_textures.push_back(tex);
|
||||
|
||||
TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
|
||||
nassertv(tc != nullptr);
|
||||
CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
|
||||
|
|
|
|||
|
|
@ -128,6 +128,10 @@ protected:
|
|||
typedef pvector<CLP(TextureContext)*> TextureContexts;
|
||||
TextureContexts _texture_contexts;
|
||||
|
||||
// List of textures we need to keep a reference to.
|
||||
typedef pvector<PT(Texture)> Textures;
|
||||
Textures _textures;
|
||||
|
||||
// The cube map face we are currently drawing to or have just finished
|
||||
// drawing to, or -1 if we are not drawing to a cube map.
|
||||
int _bound_tex_page;
|
||||
|
|
|
|||
Loading…
Reference in New Issue