}
static void
+rebind_sampler_views(struct v3d_context *v3d,
+ struct v3d_resource *rsc)
+{
+ for (int st = 0; st < PIPE_SHADER_TYPES; st++) {
+ struct v3d_texture_stateobj *tex = v3d->tex + st;
+
+ for (unsigned i = 0; i < tex->num_textures; i++) {
+ struct pipe_sampler_view *psview = tex->textures[i];
+
+ if (psview->texture != &rsc->base)
+ continue;
+
+ struct v3d_sampler_view *sview =
+ v3d_sampler_view(psview);
+
+ v3d_create_texture_shader_state_bo(v3d, sview);
+
+ v3d_flag_dirty_sampler_state(v3d, st);
+ }
+ }
+}
+
+static void
v3d_map_usage_prep(struct pipe_context *pctx,
struct pipe_resource *prsc,
unsigned usage)
v3d->dirty |= VC5_DIRTY_VTXBUF;
if (prsc->bind & PIPE_BIND_CONSTANT_BUFFER)
v3d->dirty |= VC5_DIRTY_CONSTBUF;
+ if (prsc->bind & PIPE_BIND_SAMPLER_VIEW)
+ rebind_sampler_views(v3d, rsc);
} else {
/* If we failed to reallocate, flush users so that we
* don't violate any syncing requirements.