radv: partially enable VK_KHR_shader_float16_int8

Only 8-bit integers for now, float16 requires a bit more work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Samuel Pitoiset 2019-04-01 16:18:11 +02:00
parent d099bc5829
commit c25f63872b
3 changed files with 10 additions and 0 deletions

View file

@ -902,6 +902,14 @@ void radv_GetPhysicalDeviceFeatures2(
features->storagePushConstant8 = enabled;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR: {
VkPhysicalDeviceFloat16Int8FeaturesKHR *features =
(VkPhysicalDeviceFloat16Int8FeaturesKHR*)ext;
bool enabled = pdevice->rad_info.chip_class >= VI;
features->shaderFloat16 = VK_FALSE;
features->shaderInt8 = enabled;
break;
}
default:
break;
}

View file

@ -82,6 +82,7 @@ EXTENSIONS = [
Extension('VK_KHR_relaxed_block_layout', 1, True),
Extension('VK_KHR_sampler_mirror_clamp_to_edge', 1, True),
Extension('VK_KHR_shader_draw_parameters', 1, True),
Extension('VK_KHR_shader_float16_int8', 1, 'device->rad_info.chip_class >= VI'),
Extension('VK_KHR_storage_buffer_storage_class', 1, True),
Extension('VK_KHR_surface', 25, 'RADV_HAS_SURFACE'),
Extension('VK_KHR_surface_protected_capabilities', 1, 'RADV_HAS_SURFACE'),

View file

@ -251,6 +251,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
.trinary_minmax = true,
.variable_pointers = true,
.storage_8bit = true,
.int8 = true,
},
.ubo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),
.ssbo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),