From: Erik Faye-Lund Date: Wed, 10 Jul 2019 15:10:49 +0000 (+0200) Subject: zink: store sampler and image_view counts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d29cc33a9be45c7bccc439dfffa05846482976e4;p=mesa.git zink: store sampler and image_view counts Acked-by: Jordan Justen --- diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 884455c7c35..b95a9a139ae 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -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 diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index 57c077da911..d2cc752764a 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -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];