mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 18:08:40 +02:00
mesa: Fix a crash in update_texture_state() for external texture type
NOTE: This is a candidate for the stable branch.
Signed-off-by: Abdiel <abdiel.janulgue@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit bcb10ca172)
This commit is contained in:
parent
19c1e7c664
commit
a5848562b5
2 changed files with 10 additions and 0 deletions
|
|
@ -769,6 +769,9 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
|
|||
target = GL_TEXTURE_BUFFER;
|
||||
break;
|
||||
case TEXTURE_EXTERNAL_INDEX:
|
||||
dims = 2;
|
||||
target = GL_TEXTURE_EXTERNAL_OES;
|
||||
break;
|
||||
default:
|
||||
/* no-op */
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -600,6 +600,13 @@ update_texture_state( struct gl_context *ctx )
|
|||
|
||||
texTarget = (gl_texture_index) (ffs(enabledTargets) - 1);
|
||||
texObj = _mesa_get_fallback_texture(ctx, texTarget);
|
||||
|
||||
assert(texObj);
|
||||
if (!texObj) {
|
||||
/* invalid fallback texture: don't enable the texture unit */
|
||||
continue;
|
||||
}
|
||||
|
||||
_mesa_reference_texobj(&texUnit->_Current, texObj);
|
||||
texUnit->_ReallyEnabled = 1 << texTarget;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue