Mesa (main): lavapipe: fix reported subpixel precision for lines

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 24 08:57:40 UTC 2021


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

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>

---

 src/gallium/frontends/lavapipe/lvp_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index 2c444efc887..36c7facfb6f 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -978,7 +978,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_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {



More information about the mesa-commit mailing list