pvr: implement KHR_shader_float_controls

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
Frank Binns 2025-05-15 11:18:13 +01:00 committed by Marge Bot
parent 6c0e26b002
commit e306abc6e6
4 changed files with 27 additions and 1 deletions

View file

@ -473,7 +473,7 @@ Vulkan 1.2 -- all DONE: anv, hk, nvk, panvk/v10+, tu, vn
VK_KHR_separate_depth_stencil_layouts DONE (anv, dzn, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_shader_atomic_int64 DONE (anv, lvp, nvk, panvk/v10+, radv, vn, tu/a740+)
VK_KHR_shader_float16_int8 DONE (anv, dzn, hasvk, lvp, nvk, panvk, radv, tu, vn)
VK_KHR_shader_float_controls DONE (anv, dzn, hasvk, lvp, nvk, panvk, radv, tu, v3dv, vn)
VK_KHR_shader_float_controls DONE (anv, dzn, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_shader_subgroup_extended_types DONE (anv, hasvk, lvp, nvk, panvk/v10+, radv, tu, vn)
VK_KHR_spirv_1_4 DONE (anv, dzn, hasvk, lvp, nvk, panvk/v10+, radv, tu, v3dv, vn)
VK_KHR_timeline_semaphore DONE (anv, dzn, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)

View file

@ -68,6 +68,7 @@ static const struct pvr_device_features pvr_device_features_36_V_104_796 = {
.has_tpu_image_state_v2 = true,
.has_tpu_parallel_instances = true,
.has_unified_store_depth = true,
.has_usc_alu_roundingmode_rne = true,
.has_usc_f16sop_u8 = true,
.has_usc_itrsmp = true,
.has_usc_itrsmp_enhanced = true,

View file

@ -293,6 +293,7 @@ struct pvr_device_features {
bool has_tpu_image_state_v2 : 1;
bool has_tpu_parallel_instances : 1;
bool has_unified_store_depth : 1;
bool has_usc_alu_roundingmode_rne : 1;
bool has_usc_f16sop_u8 : 1;
bool has_usc_itrsmp : 1;
bool has_usc_itrsmp_enhanced : 1;

View file

@ -194,6 +194,7 @@ static void pvr_physical_device_get_supported_extensions(
.KHR_present_wait2 = PVR_USE_WSI_PLATFORM,
.KHR_separate_depth_stencil_layouts = true,
.KHR_shader_expect_assume = false,
.KHR_shader_float_controls = true,
.KHR_swapchain = PVR_USE_WSI_PLATFORM,
.KHR_swapchain_mutable_format = PVR_USE_WSI_PLATFORM,
.KHR_timeline_semaphore = true,
@ -378,6 +379,9 @@ static bool pvr_physical_device_get_properties(
UNUSED const uint32_t max_user_vertex_components =
pvr_get_max_user_vertex_output_components(dev_info);
const bool usc_alu_roundingmode_rne =
PVR_HAS_FEATURE(dev_info, usc_alu_roundingmode_rne);
/* The workgroup invocations are limited by the case where we have a compute
* barrier - each slot has a fixed number of invocations, the whole workgroup
* may need to span multiple slots. As each slot will WAIT at the barrier
@ -587,6 +591,26 @@ static bool pvr_physical_device_get_properties(
.provokingVertexModePerPipeline = true,
.transformFeedbackPreservesTriangleFanProvokingVertex = false,
/* Vulkan 1.2 / VK_KHR_shader_float_controls */
.denormBehaviorIndependence =
VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY,
.roundingModeIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE,
.shaderSignedZeroInfNanPreserveFloat16 = true,
.shaderSignedZeroInfNanPreserveFloat32 = true,
.shaderSignedZeroInfNanPreserveFloat64 = true,
.shaderDenormPreserveFloat16 = true,
.shaderDenormPreserveFloat32 = false,
.shaderDenormPreserveFloat64 = true,
.shaderDenormFlushToZeroFloat16 = false,
.shaderDenormFlushToZeroFloat32 = false,
.shaderDenormFlushToZeroFloat64 = false,
.shaderRoundingModeRTEFloat16 = usc_alu_roundingmode_rne,
.shaderRoundingModeRTEFloat32 = usc_alu_roundingmode_rne,
.shaderRoundingModeRTEFloat64 = usc_alu_roundingmode_rne,
.shaderRoundingModeRTZFloat16 = !usc_alu_roundingmode_rne,
.shaderRoundingModeRTZFloat32 = !usc_alu_roundingmode_rne,
.shaderRoundingModeRTZFloat64 = !usc_alu_roundingmode_rne,
/* Vulkan 1.2 / VK_KHR_timeline_semaphore */
.maxTimelineSemaphoreValueDifference = UINT64_MAX,