llvmpipe: flush resources on sampler view binding
authorDave Airlie <airlied@redhat.com>
Thu, 23 Apr 2020 02:32:53 +0000 (12:32 +1000)
committerMarge Bot <eric+marge@anholt.net>
Fri, 10 Jul 2020 22:04:27 +0000 (22:04 +0000)
The resource may have been written to as images previously.

KHR-GL45.shader_image_load_store.advanced-sync-imageAccess2

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5835>

src/gallium/drivers/llvmpipe/lp_state_sampler.c

index 5bebc10ea21d99f69738c9bf92fc3d5bf1d11ea6..f802af45f5a7f45ffc830cc2ceb91cba4038b048 100644 (file)
@@ -39,6 +39,7 @@
 #include "lp_state.h"
 #include "lp_debug.h"
 #include "frontend/sw_winsys.h"
+#include "lp_flush.h"
 
 
 static void *
@@ -137,6 +138,9 @@ llvmpipe_set_sampler_views(struct pipe_context *pipe,
          debug_printf("Illegal setting of sampler_view %d created in another "
                       "context\n", i);
       }
+
+      if (views[i])
+         llvmpipe_flush_resource(pipe, views[i]->texture, 0, true, false, false, "sampler_view");
       pipe_sampler_view_reference(&llvmpipe->sampler_views[shader][start + i],
                                   views[i]);
    }