From 96a48a684878d169e2eefacb5d737e8be2de3fcd Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 4 Jul 2018 20:55:30 +0200 Subject: [PATCH] glgsg: fix issue with extract_texture_data and buffer textures It would always extract the last-created buffer texture, not the texture in question. --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index cde43352bc..b167f1baa8 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -13309,6 +13309,12 @@ do_extract_texture_data(CLP(TextureContext) *gtc) { << "glBindTexture(0x" << hex << target << dec << ", " << gtc->_index << "): " << *tex << "\n"; } +#ifndef OPENGLES + if (target == GL_TEXTURE_BUFFER) { + _glBindBuffer(GL_TEXTURE_BUFFER, gtc->_buffer); + } +#endif + GLint wrap_u, wrap_v, wrap_w; GLint minfilter, magfilter;