summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-08-25 17:12:03 -0700
committerJason Ekstrand <[email protected]>2015-08-25 18:41:21 -0700
commit9b387b5d3f4103c51079ea5298d33086af6da433 (patch)
tree4127f2284b6b4a5746bbc01bbfc6a97305057cb4 /src/mesa/main/texobj.c
parent5360edcb304e147341b934567f3bbf40e9d5a3b5 (diff)
parent1d2a844e7d55645ea3d24fb589bec03695b3d2b1 (diff)
Merge remote-tracking branch 'mesa-public/master' into vulkan
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index cd7cfd6a4fb..c5d83e145a6 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -37,6 +37,7 @@
#include "hash.h"
#include "imports.h"
#include "macros.h"
+#include "shaderimage.h"
#include "teximage.h"
#include "texobj.h"
#include "texstate.h"
@@ -1411,8 +1412,10 @@ unbind_texobj_from_image_units(struct gl_context *ctx,
for (i = 0; i < ctx->Const.MaxImageUnits; i++) {
struct gl_image_unit *unit = &ctx->ImageUnits[i];
- if (texObj == unit->TexObj)
+ if (texObj == unit->TexObj) {
_mesa_reference_texobj(&unit->TexObj, NULL);
+ *unit = _mesa_default_image_unit(ctx);
+ }
}
}
@@ -1742,10 +1745,10 @@ _mesa_BindTexture( GLenum target, GLuint texName )
* texture object will be decremented. It'll be deleted if the
* count hits zero.
*/
-void
-_mesa_bind_texture_unit(struct gl_context *ctx,
- GLuint unit,
- struct gl_texture_object *texObj)
+static void
+bind_texture_unit(struct gl_context *ctx,
+ GLuint unit,
+ struct gl_texture_object *texObj)
{
struct gl_texture_unit *texUnit;
@@ -1834,7 +1837,7 @@ _mesa_BindTextureUnit(GLuint unit, GLuint texture)
}
assert(valid_texture_object(texObj));
- _mesa_bind_texture_unit(ctx, unit, texObj);
+ bind_texture_unit(ctx, unit, texObj);
}