summaryrefslogtreecommitdiff
path: root/src/freedreno/vulkan/tu_device.c
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon@igalia.com>2021-10-04 01:24:58 +0000
committerMarge Bot <eric+marge@anholt.net>2021-10-13 12:18:01 +0000
commit542211676c58b0410662e1a959e259487c103e71 (patch)
tree82627201b04a4e3abadcf82eca426894a27052b2 /src/freedreno/vulkan/tu_device.c
parent88afceacf04ecbd5a31656749a56326fe2320428 (diff)
turnip: enable VK_EXT_line_rasterization
By default line mode is VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT, when lineRasterizationMode is VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT and primtype is line - we enable bresenham line mode. We have to disable MSAA when bresenham lines are used, this is a hardware limitation and spec allows it: "When Bresenham lines are being rasterized, sample locations may all be treated as being at the pixel center (this may affect attribute and depth interpolation)." This forces us to re-emit msaa state when line mode is changed. Signed-off-by: Hyunjun Ko <zzoon@igalia.com> Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6020>
Diffstat (limited to 'src/freedreno/vulkan/tu_device.c')
-rw-r--r--src/freedreno/vulkan/tu_device.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index aff36984487..1d41260e93c 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -190,6 +190,7 @@ get_device_extensions(const struct tu_physical_device *device,
.EXT_shader_viewport_index_layer = true,
.EXT_vertex_attribute_divisor = true,
.EXT_provoking_vertex = true,
+ .EXT_line_rasterization = true,
#ifdef ANDROID
.ANDROID_native_buffer = true,
#endif
@@ -735,6 +736,17 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->mutableDescriptorType = true;
break;
}
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+ VkPhysicalDeviceLineRasterizationFeaturesEXT *features =
+ (VkPhysicalDeviceLineRasterizationFeaturesEXT *)ext;
+ features->rectangularLines = true;
+ features->bresenhamLines = true;
+ features->smoothLines = false;
+ features->stippledRectangularLines = false;
+ features->stippledBresenhamLines = false;
+ features->stippledSmoothLines = false;
+ break;
+ }
default:
break;
@@ -1084,6 +1096,12 @@ tu_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
properties->transformFeedbackPreservesTriangleFanProvokingVertex = false;
break;
}
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+ VkPhysicalDeviceLineRasterizationPropertiesEXT *props =
+ (VkPhysicalDeviceLineRasterizationPropertiesEXT *)ext;
+ props->lineSubPixelPrecisionBits = 8;
+ break;
+ }
default:
break;