i965: Enable INTEL_shader_integer_functions2 on Gen8+
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 11 Sep 2018 23:50:06 +0000 (16:50 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jan 2020 00:18:57 +0000 (00:18 +0000)
v2: Use new lower_hadd64 and lower_usub_sat64 flags.

v3: Enable SPIR-V capability.

v4: Move lowering options to COMMON_SCALAR_OPTIONS.  Suggested by Caio.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/767>

src/intel/compiler/brw_compiler.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_extensions.c

index a3b8ddb4bd7fe4a8de63090659d7466d6353dd37..3d0bec30dcf1f8cf8816fd8fc5d92a667b875b46 100644 (file)
@@ -61,6 +61,8 @@
    .lower_unpack_snorm_4x8 = true,                                            \
    .lower_unpack_unorm_2x16 = true,                                           \
    .lower_unpack_unorm_4x8 = true,                                            \
+   .lower_usub_sat64 = true,                                                  \
+   .lower_hadd64 = true,                                                      \
    .max_unroll_iterations = 32
 
 static const struct nir_shader_compiler_options scalar_nir_options = {
index c30f1a04f30f7f8f8406fe1e854ea54394f0ac07..2676382b48920afbb394c019fb4164ba098de3cc 100644 (file)
@@ -411,6 +411,7 @@ brw_initialize_spirv_supported_capabilities(struct brw_context *brw)
    ctx->Const.SpirVCapabilities.tessellation = true;
    ctx->Const.SpirVCapabilities.transform_feedback = devinfo->gen >= 7;
    ctx->Const.SpirVCapabilities.variable_pointers = true;
+   ctx->Const.SpirVCapabilities.integer_functions2 = devinfo->gen >= 8;
 }
 
 static void
index e7ea8cde52e555cdd4125c9561633473c78ecb33..01dacbec8d7e78591792f5c9feff472952e4d924 100644 (file)
@@ -320,6 +320,11 @@ intelInitExtensions(struct gl_context *ctx)
       /* requires ARB_gpu_shader_int64 */
       ctx->Extensions.ARB_shader_ballot = true;
       ctx->Extensions.ARB_ES3_2_compatibility = true;
+
+      /* Currently only implemented in the scalar backend, so only enable for
+       * Gen8+.  Eventually Gen6+ could be supported.
+       */
+      ctx->Extensions.INTEL_shader_integer_functions2 = true;
    }
 
    if (devinfo->gen >= 9) {