pvr: add support for (EXT|KHR)_line_rasterization

Signed-off-by: James Fitzpatrick <james.fitzpatrick@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512>
This commit is contained in:
James Fitzpatrick 2024-04-30 08:40:05 +01:00 committed by Marge Bot
parent 7e11ec20e4
commit 17468aee4b
3 changed files with 28 additions and 2 deletions

View file

@ -517,7 +517,7 @@ Vulkan 1.4 -- all DONE: anv, hk, lvp, nvk, panvk/v10+, radv/gfx8+, tu/a7xx+, vn
VK_KHR_dynamic_rendering_local_read DONE (anv, lvp, nvk, panvk, radv, tu, vn)
VK_KHR_global_priority DONE (anv, lvp, nvk, panvk, radv, tu, vn)
VK_KHR_index_type_uint8 DONE (anv, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_line_rasterization DONE (anv, lvp, nvk, panvk, radv, tu, v3dv, vn)
VK_KHR_line_rasterization DONE (anv, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_load_store_op_none DONE (anv, lvp, nvk, panvk, radv, tu, v3dv, vn)
VK_KHR_maintenance5 DONE (anv, lvp, nvk, panvk/v10+, radv, tu, v3dv, vn)
VK_KHR_maintenance6 DONE (anv, lvp, nvk, panvk/v10+, radv, tu, vn)
@ -635,7 +635,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_EXT_image_view_min_lod DONE (anv, hasvk, hk, nvk, radv, tu, vn)
VK_EXT_index_type_uint8 DONE (anv, hasvk, hk, nvk, lvp, panvk, pvr, radv/gfx8+, tu, v3dv, vn)
VK_EXT_legacy_vertex_attributes DONE (anv, lvp, nvk, radv, tu, vn)
VK_EXT_line_rasterization DONE (anv, hasvk, hk, nvk, panvk, lvp, radv, tu, v3dv, vn)
VK_EXT_line_rasterization DONE (anv, hasvk, hk, nvk, panvk, pvr, lvp, radv, tu, v3dv, vn)
VK_EXT_load_store_op_none DONE (anv, hk, lvp, nvk, panvk, radv, tu, v3dv, vn)
VK_EXT_memory_budget DONE (anv, hasvk, lvp, nvk, radv, tu, v3dv, vn)
VK_EXT_memory_priority DONE (lvp, radv)

View file

@ -5900,6 +5900,21 @@ static void pvr_setup_ppp_control(struct pvr_cmd_buffer *const cmd_buffer)
default:
UNREACHABLE("Unsupported cull mode!");
}
if (dynamic_state->rs.line.mode ==
VK_LINE_RASTERIZATION_MODE_BRESENHAM_KHR) {
switch (topology) {
case VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
case VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
control.prim_msaa = true;
break;
default:
break;
}
}
}
if (ppp_control != ppp_state->ppp_control) {

View file

@ -188,6 +188,7 @@ static void pvr_physical_device_get_supported_extensions(
.KHR_image_format_list = true,
.KHR_imageless_framebuffer = true,
.KHR_index_type_uint8 = false,
.KHR_line_rasterization = true,
.KHR_maintenance1 = true,
.KHR_maintenance2 = true,
.KHR_maintenance3 = true,
@ -216,6 +217,7 @@ static void pvr_physical_device_get_supported_extensions(
.EXT_host_query_reset = true,
.EXT_image_2d_view_of_3d = true,
.EXT_index_type_uint8 = false,
.EXT_line_rasterization = true,
.EXT_physical_device_drm = true,
.EXT_private_data = true,
.EXT_provoking_vertex = true,
@ -422,6 +424,9 @@ static void pvr_physical_device_get_supported_features(
/* VK_EXT_depth_clip_enable */
.depthClipEnable = true,
/* VK_KHR_line_rasterization */
.bresenhamLines = true,
};
}
@ -487,6 +492,9 @@ static bool pvr_physical_device_get_properties(
const VkDeviceSize max_memory_alloc_size =
pdevice->memory.memoryHeaps[0].size;
const uint32_t line_sub_pixel_precision_bits =
PVR_HAS_FEATURE(dev_info, simple_internal_parameter_format) ? 4U : 8U;
*properties = (struct vk_properties){
/* Vulkan 1.0 */
.apiVersion = get_api_version(),
@ -759,6 +767,9 @@ static bool pvr_physical_device_get_properties(
VK_RESOLVE_MODE_SAMPLE_ZERO_BIT,
.independentResolveNone = true,
.independentResolve = true,
/* VK_KHR_line_rasterization */
.lineSubPixelPrecisionBits = line_sub_pixel_precision_bits,
};
if (PVR_HAS_FEATURE(dev_info, gpu_multicore_support)) {