llvmpipe: hack-fix bugs due to bogus bind flags
[mesa.git] / src / gallium / drivers / llvmpipe / lp_state_sampler.c
index 81b998ac41010fd9f1e484e3380f465d23720c9e..4441f2a40d624bd43ea16ccb4330e939cf0114dc 100644 (file)
@@ -169,11 +169,13 @@ llvmpipe_create_sampler_view(struct pipe_context *pipe,
 {
    struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
    /*
-    * XXX we REALLY want to see the correct bind flag here but the OpenGL
-    * state tracker can't guarantee that at least for texture buffer objects.
+    * XXX: bind flags from OpenGL state tracker are notoriously unreliable.
+    * This looks unfixable, so fix the bind flags instead when it happens.
     */
-   if (!(texture->bind & PIPE_BIND_SAMPLER_VIEW))
+   if (!(texture->bind & PIPE_BIND_SAMPLER_VIEW)) {
       debug_printf("Illegal sampler view creation without bind flag\n");
+      texture->bind |= PIPE_BIND_SAMPLER_VIEW;
+   }
 
    if (view) {
       *view = *templ;