summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r--src/mesa/main/texstate.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 82e69ae11b5..1810b88b2bf 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -407,7 +407,7 @@ update_tex_combine(struct gl_context *ctx, struct gl_texture_unit *texUnit)
}
else if (format == GL_DEPTH_COMPONENT ||
format == GL_DEPTH_STENCIL_EXT) {
- format = texObj->DepthMode;
+ format = texObj->Sampler.DepthMode;
}
calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);
texUnit->_CurrentCombine = & texUnit->_EnvMode;
@@ -827,6 +827,12 @@ _mesa_free_texture_data(struct gl_context *ctx)
/* GL_ARB_texture_buffer_object */
_mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject, NULL);
+
+#if FEATURE_sampler_objects
+ for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
+ _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[u].Sampler, NULL);
+ }
+#endif
}