zink: store sampler and image_view counts
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 10 Jul 2019 15:10:49 +0000 (17:10 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:46 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h

index 884455c7c35798c4ba9a2805c470fee029791aa0..b95a9a139aeaa256fd2d6da911114e365b6d835c 100644 (file)
@@ -180,6 +180,7 @@ zink_bind_sampler_states(struct pipe_context *pctx,
    struct zink_context *ctx = zink_context(pctx);
    for (unsigned i = 0; i < num_samplers; ++i)
       ctx->samplers[shader][start_slot + i] = (VkSampler)samplers[i];
+   ctx->num_samplers[shader] = start_slot + num_samplers;
 }
 
 static void
@@ -444,6 +445,7 @@ zink_set_sampler_views(struct pipe_context *pctx,
          &ctx->image_views[shader_type][start_slot + i],
          views[i]);
    }
+   ctx->num_image_views[shader_type] = start_slot + num_views;
 }
 
 static void
index 57c077da911dbe5210f05a76979fbebece53b3b4..d2cc752764ac1a195ada26fc909c70e42c1081ad 100644 (file)
@@ -97,7 +97,9 @@ struct zink_context {
    uint32_t buffers_enabled_mask;
 
    VkSampler samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
+   unsigned num_samplers[PIPE_SHADER_TYPES];
    struct pipe_sampler_view *image_views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
+   unsigned num_image_views[PIPE_SHADER_TYPES];
 
    float blend_constants[4];