anv: Implement VK_NV_compute_shader_derivatives
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 28 Mar 2019 17:36:43 +0000 (10:36 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 9 Apr 2019 02:29:33 +0000 (19:29 -0700)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_extensions.py
src/intel/vulkan/anv_pipeline.c

index b0a6e10cabcdd07855e8563615e5122c0fa69318..9d4f93c910fcb120922b0ab53f8f4d2b051d41c4 100644 (file)
@@ -1051,6 +1051,14 @@ void anv_GetPhysicalDeviceFeatures2(
          break;
       }
 
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+         VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *features =
+            (VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *)ext;
+         features->computeDerivativeGroupQuads = true;
+         features->computeDerivativeGroupLinear = true;
+         break;
+      }
+
       default:
          anv_debug_ignored_stype(ext->sType);
          break;
index 37c1203416e9ade63e9c00e79288dc7c516365df..db6b0217f4d267a52229f15873064c47860b1445 100644 (file)
@@ -143,6 +143,7 @@ EXTENSIONS = [
     Extension('VK_ANDROID_native_buffer',                 5, 'ANDROID'),
     Extension('VK_GOOGLE_decorate_string',                1, True),
     Extension('VK_GOOGLE_hlsl_functionality1',            1, True),
+    Extension('VK_NV_compute_shader_derivatives',         1, True),
 ]
 
 # Sort the extension list the way we expect: KHR, then EXT, then vendors
index 1c51b83b5bafc43623950b1289b4b49be84de9c5..b0fef540e45b334a4fa6f614aec7457437f90373 100644 (file)
@@ -137,6 +137,7 @@ anv_shader_compile_to_nir(struct anv_device *device,
    struct spirv_to_nir_options spirv_options = {
       .lower_workgroup_access_to_offsets = true,
       .caps = {
+         .derivative_group = true,
          .device_group = true,
          .draw_parameters = true,
          .float64 = pdevice->info.gen >= 8,