Remove if (tObj) conditional so that texture units without a texture image
authorBrian <brian@yutani.localnet.net>
Mon, 8 Jan 2007 23:10:34 +0000 (16:10 -0700)
committerBrian <brian@yutani.localnet.net>
Mon, 8 Jan 2007 23:10:34 +0000 (16:10 -0700)
return black (0,0,0,1) when sampled.

src/mesa/swrast/s_context.c

index 749e278..6e3475b 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.1
+ * Version:  6.5.3
  *
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -499,9 +499,10 @@ _swrast_update_texture_samplers(GLcontext *ctx)
 
    for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
       const struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current;
-      if (tObj)
-         swrast->TextureSample[u] =
-            _swrast_choose_texture_sample_func(ctx, tObj);
+      /* Note: If tObj is NULL, the sample function will be a simple
+       * function that just returns opaque black (0,0,0,1).
+       */
+      swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj);
    }
 }