turnip: implement VK_KHR_shader_float_controls

This matches the blob and doesn't require actually implementing controls
since the supported modes are just what the HW does.

Passes tests under:

dEQP-VK.spirv_assembly.*.float_controls.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>
This commit is contained in:
Jonathan Marek 2021-03-23 15:20:41 +02:00 committed by Marge Bot
parent de195671bd
commit 3777ecdf11
3 changed files with 24 additions and 1 deletions

View file

@ -890,7 +890,28 @@ tu_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
props->maxDescriptorSetUpdateAfterBindInputAttachments = max_descriptor_set_size;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
VkPhysicalDeviceFloatControlsProperties *properties =
(VkPhysicalDeviceFloatControlsProperties *) ext;
properties->denormBehaviorIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL;
properties->roundingModeIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL;
properties->shaderSignedZeroInfNanPreserveFloat16 = true;
properties->shaderSignedZeroInfNanPreserveFloat32 = true;
properties->shaderSignedZeroInfNanPreserveFloat64 = false;
properties->shaderDenormPreserveFloat16 = false;
properties->shaderDenormPreserveFloat32 = false;
properties->shaderDenormPreserveFloat64 = false;
properties->shaderDenormFlushToZeroFloat16 = true;
properties->shaderDenormFlushToZeroFloat32 = true;
properties->shaderDenormFlushToZeroFloat64 = false;
properties->shaderRoundingModeRTEFloat16 = true;
properties->shaderRoundingModeRTEFloat32 = true;
properties->shaderRoundingModeRTEFloat64 = false;
properties->shaderRoundingModeRTZFloat16 = false;
properties->shaderRoundingModeRTZFloat32 = false;
properties->shaderRoundingModeRTZFloat64 = false;
break;
}
default:
break;
}

View file

@ -110,6 +110,7 @@ EXTENSIONS = [
Extension('VK_KHR_storage_buffer_storage_class', 1, True),
Extension('VK_KHR_external_fence_capabilities', 1, True),
Extension('VK_KHR_pipeline_executable_properties', 1, True),
Extension('VK_KHR_shader_float_controls', 1, True),
]
MAX_API_VERSION = VkVersion(MAX_API_VERSION)

View file

@ -73,6 +73,7 @@ tu_spirv_to_nir(struct tu_device *dev,
.descriptor_array_dynamic_indexing = true,
.descriptor_array_non_uniform_indexing = true,
.runtime_descriptor_array = true,
.float_controls = true,
},
};