From: Brian Paul Date: Thu, 3 Jul 2008 01:11:49 +0000 (-0600) Subject: gallium: replace an assertion with "if (!texobj) continue" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=98b7174ad6f6a74361e58136bdd235a092b07a40;p=mesa.git gallium: replace an assertion with "if (!texobj) continue" It's possible to call update_samplers() between the time a fragment shader is bound and when a texture image is defined (such as glClear). This fixes the case where we don't have a complete texture object yet. --- diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 1e182eef1c5..3ba6a971f6f 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -136,7 +136,8 @@ update_samplers(struct st_context *st) const struct gl_texture_object *texobj = st->ctx->Texture.Unit[texUnit]._Current; - assert(texobj); + if (!texobj) + continue; sampler->wrap_s = gl_wrap_to_sp(texobj->WrapS); sampler->wrap_t = gl_wrap_to_sp(texobj->WrapT);