From 71cfe8fb60f731a16e1ca4dfe362d3c96b607b1d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 9 Apr 2023 14:59:57 -0400 Subject: [PATCH] panfrost: Use u_default_get_sample_position The Mali sample positions are the standard sample positions. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Mike Blumenkrantz Reviewed-by: Emma Anholt Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 12 ++---------- src/panfrost/lib/pan_device.h | 2 -- src/panfrost/lib/pan_samples.c | 13 ------------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 4b3c29f..8b86ad4 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -31,6 +31,7 @@ #include "util/u_helpers.h" #include "util/u_memory.h" #include "util/u_prim.h" +#include "util/u_sample_positions.h" #include "util/u_vbuf.h" #include "util/u_viewport.h" @@ -4392,15 +4393,6 @@ prepare_shader(struct panfrost_compiled_shader *state, } static void -panfrost_get_sample_position(struct pipe_context *context, - unsigned sample_count, unsigned sample_index, - float *out_value) -{ - panfrost_query_sample_position(panfrost_sample_pattern(sample_count), - sample_index, out_value); -} - -static void screen_destroy(struct pipe_screen *pscreen) { struct panfrost_device *dev = pan_device(pscreen); @@ -4475,7 +4467,7 @@ context_init(struct pipe_context *pipe) pipe->create_sampler_state = panfrost_create_sampler_state; pipe->create_blend_state = panfrost_create_blend_state; - pipe->get_sample_position = panfrost_get_sample_position; + pipe->get_sample_position = u_default_get_sample_position; } #if PAN_ARCH <= 5 diff --git a/src/panfrost/lib/pan_device.h b/src/panfrost/lib/pan_device.h index e441f1e..3b85f35 100644 --- a/src/panfrost/lib/pan_device.h +++ b/src/panfrost/lib/pan_device.h @@ -222,8 +222,6 @@ void panfrost_upload_sample_positions(struct panfrost_device *dev); mali_ptr panfrost_sample_positions(const struct panfrost_device *dev, enum mali_sample_pattern pattern); -void panfrost_query_sample_position(enum mali_sample_pattern pattern, - unsigned sample_idx, float *out); unsigned panfrost_query_l2_slices(const struct panfrost_device *dev); diff --git a/src/panfrost/lib/pan_samples.c b/src/panfrost/lib/pan_samples.c index f23810d..f6ea9eb 100644 --- a/src/panfrost/lib/pan_samples.c +++ b/src/panfrost/lib/pan_samples.c @@ -151,16 +151,3 @@ panfrost_upload_sample_positions(struct panfrost_device *dev) memcpy(dev->sample_positions->ptr.cpu, sample_position_lut, sizeof(sample_position_lut)); } - -/* CPU side LUT query, to implement glGetMultisamplefv */ - -void -panfrost_query_sample_position(enum mali_sample_pattern pattern, - unsigned sample_idx, float *out) -{ - struct mali_sample_position pos = - sample_position_lut[pattern].positions[sample_idx]; - - out[0] = decode_position(pos.x); - out[1] = decode_position(pos.y); -} -- 2.7.4