i965: actually detect whether a sampler is enabled/disabled
authorZack Rusin <zack@tungstengraphics.com>
Wed, 19 Dec 2007 11:00:30 +0000 (06:00 -0500)
committerZack Rusin <zack@tungstengraphics.com>
Wed, 19 Dec 2007 11:24:16 +0000 (06:24 -0500)
src/mesa/pipe/i965simple/brw_wm_sampler_state.c

index fbeea8c8090a49a864386544701ff012b791f5d9..cfb430eb09ca626a1f24a741eaea038292abc607 100644 (file)
@@ -236,7 +236,8 @@ static void upload_wm_samplers(struct brw_context *brw)
 
    /* BRW_NEW_SAMPLER */
    for (unit = 0; unit < BRW_MAX_TEX_UNIT; unit++) {
-      if (brw->attribs.Samplers[unit]) { /* FIXME: correctly detect enabled ones */
+      /* determine unit enable/disable by looking for a bound texture */
+      if (brw->attribs.Texture[unit]) {
          const struct pipe_sampler_state *sampler = brw->attribs.Samplers[unit];
         unsigned sdc_gs_offset = upload_default_color(brw, sampler->border_color);