Mesa (main): panfrost: Match sampler "nearest" names

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 23 20:28:03 UTC 2021


Module: Mesa
Branch: main
Commit: c80732eab30c043f0d2dc5641030e747f645e6a1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c80732eab30c043f0d2dc5641030e747f645e6a1

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Jul 12 19:32:17 2021 -0400

panfrost: Match sampler "nearest" names

Midgard calls this nearest but Bifrost calls it point sample. Of the
two, nearest is the standard term, so change the Bifrost XML to use that
name. That way we can share more code constructing samplers.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11851>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 4 ++--
 src/panfrost/lib/midgard.xml                 | 4 ++--
 src/panfrost/lib/pan_blitter.c               | 4 ++--
 src/panfrost/vulkan/panvk_device.c           | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index a7b3e6cf375..c16ea88c5e7 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -176,8 +176,8 @@ panfrost_sampler_desc_init_bifrost(const struct pipe_sampler_state *cso,
         bool using_nearest = cso->min_img_filter == PIPE_TEX_MIPFILTER_NEAREST;
 
         pan_pack(hw, BIFROST_SAMPLER, cfg) {
-                cfg.point_sample_magnify = cso->mag_img_filter == PIPE_TEX_FILTER_NEAREST;
-                cfg.point_sample_minify = cso->min_img_filter == PIPE_TEX_FILTER_NEAREST;
+                cfg.magnify_nearest = cso->mag_img_filter == PIPE_TEX_FILTER_NEAREST;
+                cfg.minify_nearest = cso->min_img_filter == PIPE_TEX_FILTER_NEAREST;
                 cfg.mipmap_mode = pan_pipe_to_mipmode(cso->min_mip_filter);
                 cfg.normalized_coordinates = cso->normalized_coords;
 
diff --git a/src/panfrost/lib/midgard.xml b/src/panfrost/lib/midgard.xml
index ab8fb083a15..8fc399bc4ea 100644
--- a/src/panfrost/lib/midgard.xml
+++ b/src/panfrost/lib/midgard.xml
@@ -768,8 +768,8 @@
     <field name="Clamp integer coordinates" size="1" start="0:24" type="bool"/>
     <field name="Normalized Coordinates" size="1" start="0:25" type="bool" default="true"/>
     <field name="Clamp integer array indices" size="1" start="0:26" type="bool" default="true"/>
-    <field name="Point sample minify" size="1" start="0:27" type="bool" default="false"/>
-    <field name="Point sample magnify" size="1" start="0:28" type="bool" default="false"/>
+    <field name="Minify nearest" size="1" start="0:27" type="bool" default="false"/>
+    <field name="Magnify nearest" size="1" start="0:28" type="bool" default="false"/>
     <!--- Set for 0.5, clear for 0.0 -->
     <field name="Magnify cutoff" size="1" start="0:29" type="bool" default="false"/>
     <field name="Mipmap Mode" size="2" start="0:30" type="Mipmap Mode" default="Nearest"/>
diff --git a/src/panfrost/lib/pan_blitter.c b/src/panfrost/lib/pan_blitter.c
index 74c8c015d0b..a858fe8aa76 100644
--- a/src/panfrost/lib/pan_blitter.c
+++ b/src/panfrost/lib/pan_blitter.c
@@ -901,8 +901,8 @@ pan_blitter_emit_bifrost_sampler(struct pan_pool *pool,
         pan_pack(sampler.cpu, BIFROST_SAMPLER, cfg) {
                 cfg.seamless_cube_map = false;
                 cfg.normalized_coordinates = false;
-                cfg.point_sample_minify = nearest_filter;
-                cfg.point_sample_magnify = nearest_filter;
+                cfg.minify_nearest = nearest_filter;
+                cfg.magnify_nearest = nearest_filter;
         }
 
         return sampler.gpu;
diff --git a/src/panfrost/vulkan/panvk_device.c b/src/panfrost/vulkan/panvk_device.c
index 4a0dbd71675..4b68b9ef0e6 100644
--- a/src/panfrost/vulkan/panvk_device.c
+++ b/src/panfrost/vulkan/panvk_device.c
@@ -1999,8 +1999,8 @@ panvk_init_bifrost_sampler(struct panvk_sampler *sampler,
       vk_find_struct_const(pCreateInfo->pNext, SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT);
 
    pan_pack(&sampler->desc, BIFROST_SAMPLER, cfg) {
-      cfg.point_sample_magnify = pCreateInfo->magFilter == VK_FILTER_LINEAR;
-      cfg.point_sample_minify = pCreateInfo->minFilter == VK_FILTER_LINEAR;
+      cfg.magnify_nearest = pCreateInfo->magFilter == VK_FILTER_LINEAR;
+      cfg.minify_nearest = pCreateInfo->minFilter == VK_FILTER_LINEAR;
       cfg.mipmap_mode = panvk_translate_sampler_mipmap_mode(pCreateInfo->mipmapMode);
       cfg.normalized_coordinates = !pCreateInfo->unnormalizedCoordinates;
 



More information about the mesa-commit mailing list