Mesa (staging/21.2): lavapipe: fix reported subpixel precision for lines

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 24 20:29:58 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: df77e46c5acadb23b6748b77228d46844dca9f3d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=df77e46c5acadb23b6748b77228d46844dca9f3d

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Mon Aug  9 08:40:42 2021 +0200

lavapipe: fix reported subpixel precision for lines

We have no reason to report a subpixel precision of 4 for lines; in fact
LLVMpipe uses 8 subpixel bits for lines, similar to other primitives.
But let's use the pipe-cap for this instead of hard-coding it.

Fixes: 9fbf6b2abff ("lavapipe: implement VK_EXT_line_rasterization")
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12277>
(cherry picked from commit a16f3963d36e66e6610c98083595e66712fbb296)

---

 .pick_status.json                           | 2 +-
 src/gallium/frontends/lavapipe/lvp_device.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 8a11640f839..3f388f93627 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -139,7 +139,7 @@
         "description": "lavapipe: fix reported subpixel precision for lines",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "9fbf6b2abff19dc4c3e942569737ac3e67302e1d"
     },
diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index 58ea8238a5d..a575ab167cb 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -957,7 +957,9 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceProperties2(
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
          VkPhysicalDeviceLineRasterizationPropertiesEXT *properties =
             (VkPhysicalDeviceLineRasterizationPropertiesEXT *)ext;
-         properties->lineSubPixelPrecisionBits = 4;
+         properties->lineSubPixelPrecisionBits =
+            pdevice->pscreen->get_param(pdevice->pscreen,
+                                        PIPE_CAP_RASTERIZER_SUBPIXEL_BITS);
          break;
       }
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {



More information about the mesa-commit mailing list