mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 16:18:06 +02:00
zink: add a pipe_context::set_sample_locations hook
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11189>
This commit is contained in:
parent
9075f623a4
commit
60e98d0f47
3 changed files with 17 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue