From 3a27e406edf5339bb3f029f2542188d19eca4c6c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 6 Sep 2021 10:30:40 +1000 Subject: [PATCH] lavapipe: enable KHR_shader_float16_int8 Acked-By: Mike Blumenkrantz Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/frontends/lavapipe/lvp_device.c | 8 ++++++++ src/gallium/frontends/lavapipe/lvp_pipeline.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index 95c3193f51a..1714a36b661 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -119,6 +119,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported = .KHR_separate_depth_stencil_layouts = true, .KHR_shader_atomic_int64 = true, .KHR_shader_draw_parameters = true, + .KHR_shader_float16_int8 = true, .KHR_storage_buffer_storage_class = true, #ifdef LVP_USE_WSI_PLATFORM .KHR_swapchain = true, @@ -626,6 +627,13 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures2( features->bufferDeviceAddressMultiDevice = false; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: { + VkPhysicalDeviceShaderFloat16Int8Features *features = + (VkPhysicalDeviceShaderFloat16Int8Features*)ext; + features->shaderFloat16 = pdevice->pscreen->get_shader_param(pdevice->pscreen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_FP16) != 0; + features->shaderInt8 = true; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: { VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *features = (void *)ext; features->shaderBufferInt64Atomics = true; diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c index 07172fd789f..012ac0bd048 100644 --- a/src/gallium/frontends/lavapipe/lvp_pipeline.c +++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c @@ -505,6 +505,8 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline, .subgroup_ballot = true, .subgroup_quad = true, .subgroup_vote = true, + .int8 = true, + .float16 = true, }, .ubo_addr_format = nir_address_format_32bit_index_offset, .ssbo_addr_format = nir_address_format_32bit_index_offset,