diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 96b34e8f45b..5cd34ace8a1 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1922,6 +1922,18 @@ zink_set_sample_mask(struct pipe_context *pctx, unsigned sample_mask) ctx->gfx_pipeline_state.dirty = true; } +static void +zink_set_sample_locations(struct pipe_context *pctx, size_t size, const uint8_t *locations) +{ + struct zink_context *ctx = zink_context(pctx); + + ctx->gfx_pipeline_state.sample_locations_enabled = size && locations; + ctx->sample_locations_changed = ctx->gfx_pipeline_state.sample_locations_enabled; + if (size > sizeof(ctx->sample_locations)) + size = sizeof(ctx->sample_locations); + memcpy(ctx->sample_locations, locations, size); +} + static VkAccessFlags access_src_flags(VkImageLayout layout) { @@ -3296,6 +3308,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) ctx->base.set_sampler_views = zink_set_sampler_views; ctx->base.sampler_view_destroy = zink_sampler_view_destroy; ctx->base.get_sample_position = zink_get_sample_position; + ctx->base.set_sample_locations = zink_set_sample_locations; zink_program_init(ctx); diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index 864cd3b29c5..4c468e92d81 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -209,6 +209,9 @@ struct zink_context { float line_width; float blend_constants[4]; + bool sample_locations_changed; + uint8_t sample_locations[2 * 4 * 8 * 16]; + bool drawid_broken; struct pipe_stencil_ref stencil_ref; diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h index 0c39acc30e3..fec7af77276 100644 --- a/src/gallium/drivers/zink/zink_pipeline.h +++ b/src/gallium/drivers/zink/zink_pipeline.h @@ -74,6 +74,7 @@ struct zink_gfx_pipeline_state { uint32_t vertex_buffers_enabled_mask; uint32_t vertex_strides[PIPE_MAX_ATTRIBS]; + bool sample_locations_enabled; bool have_EXT_extended_dynamic_state; VkPipeline pipeline;