sampler.normalized_coords = normalized;
 
       if (fpv) {
+         /* drawing a color image */
          const struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS];
          uint num = MAX2(MAX2(fpv->drawpix_sampler, fpv->pixelmap_sampler) + 1,
                          st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
 
          cso_set_samplers(cso, PIPE_SHADER_FRAGMENT, num, samplers);
       } else {
+         /* drawing a depth/stencil image */
          const struct pipe_sampler_state *samplers[2] = {&sampler, &sampler};
 
          cso_set_samplers(cso, PIPE_SHADER_FRAGMENT, num_sampler_view, samplers);
       }
    }
 
+   /* user textures, plus the drawpix textures */
+   if (fpv) {
+      /* drawing a color image */
+      struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
+      uint num = MAX3(fpv->drawpix_sampler + 1,
+                      fpv->pixelmap_sampler + 1,
+                      st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
+
+      memcpy(sampler_views, st->state.sampler_views[PIPE_SHADER_FRAGMENT],
+             sizeof(sampler_views));
+
+      sampler_views[fpv->drawpix_sampler] = sv[0];
+      if (sv[1])
+         sampler_views[fpv->pixelmap_sampler] = sv[1];
+      cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num, sampler_views);
+   } else {
+      /* drawing a depth/stencil image */
+      cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num_sampler_view, sv);
+   }
+
    /* viewport state: viewport matching window dims */
    {
       const float w = (float) ctx->DrawBuffer->Width;
    cso_set_vertex_elements(cso, 3, st->velems_util_draw);
    cso_set_stream_outputs(st->cso_context, 0, NULL, NULL);
 
-   /* user textures, plus the drawpix textures */
-   if (fpv) {
-      struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
-      uint num = MAX3(fpv->drawpix_sampler + 1,
-                      fpv->pixelmap_sampler + 1,
-                      st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
-
-      memcpy(sampler_views, st->state.sampler_views[PIPE_SHADER_FRAGMENT],
-             sizeof(sampler_views));
-
-      sampler_views[fpv->drawpix_sampler] = sv[0];
-      if (sv[1])
-         sampler_views[fpv->pixelmap_sampler] = sv[1];
-      cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num, sampler_views);
-   } else
-      cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num_sampler_view, sv);
-
    /* Compute Gallium window coords (y=0=top) with pixel zoom.
     * Recall that these coords are transformed by the current
     * vertex shader and viewport transformation.