[Mesa-dev] [PATCH 6/6] st/mesa: don't modify immutable textures
nobled
nobled at dreamwidth.org
Wed May 2 10:06:14 PDT 2012
---
src/mesa/state_tracker/st_manager.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/mesa/state_tracker/st_manager.c
b/src/mesa/state_tracker/st_manager.c
index d54b7ed..5a1fb73 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -501,6 +501,14 @@ st_context_teximage(struct st_context_iface *stctxi,
texObj = _mesa_select_tex_object(ctx, texUnit, target);
_mesa_lock_texture(ctx, texObj);
+ if (texObj->Immutable) {
+ /* Ideally, we should not be able to get here. */
+ _mesa_problem(ctx, "Texture %u is immutable: its format and dimensions"
+ " can't be modified.", texObj->Name);
+ _mesa_unlock_texture(ctx, texObj);
+ return FALSE;
+ }
+
stObj = st_texture_object(texObj);
/* switch to surface based */
if (!stObj->surface_based) {
--
1.7.4.1
More information about the mesa-dev
mailing list