[Mesa-dev] [PATCH] radv: add VK_NV_compute_shader_derivates support

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Mon Apr 22 11:53:18 UTC 2019


On Fri, Apr 19, 2019 at 12:37 PM Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
>
> Only computeDerivativeGroupLinear is supported for now.

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
>
> All crucible tests pass.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_device.c      | 7 +++++++
>  src/amd/vulkan/radv_extensions.py | 1 +
>  src/amd/vulkan/radv_shader.c      | 1 +
>  3 files changed, 9 insertions(+)
>
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index 774ee5b91df..a31860eabf4 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -927,6 +927,13 @@ void radv_GetPhysicalDeviceFeatures2(
>                         features->descriptorBindingInlineUniformBlockUpdateAfterBind = true;
>                         break;
>                 }
> +               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
> +                       VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *features =
> +                               (VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *)ext;
> +                       features->computeDerivativeGroupQuads = false;
> +                       features->computeDerivativeGroupLinear = true;
> +                       break;
> +               }
>                 default:
>                         break;
>                 }
> diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py
> index 40fc585c503..9743ce1a774 100644
> --- a/src/amd/vulkan/radv_extensions.py
> +++ b/src/amd/vulkan/radv_extensions.py
> @@ -133,6 +133,7 @@ EXTENSIONS = [
>      Extension('VK_AMD_shader_trinary_minmax',             1, True),
>      Extension('VK_GOOGLE_decorate_string',                1, True),
>      Extension('VK_GOOGLE_hlsl_functionality1',            1, True),
> +    Extension('VK_NV_compute_shader_derivatives',         1, 'device->rad_info.chip_class >= VI'),
>  ]
>
>  class VkVersion:
> diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
> index c802abb0e08..13f1f9aa9dc 100644
> --- a/src/amd/vulkan/radv_shader.c
> +++ b/src/amd/vulkan/radv_shader.c
> @@ -223,6 +223,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
>                 const struct spirv_to_nir_options spirv_options = {
>                         .lower_ubo_ssbo_access_to_offsets = true,
>                         .caps = {
> +                               .derivative_group = true,
>                                 .descriptor_array_dynamic_indexing = true,
>                                 .device_group = true,
>                                 .draw_parameters = true,
> --
> 2.21.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list