i965/nir: Use NIR lowering for ffma for gen < 6
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 17 Mar 2015 20:10:19 +0000 (13:10 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 23 Mar 2015 08:01:14 +0000 (01:01 -0700)
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_context.c

index a39443aa6e468efd3354cb3eeddfaf29f56af088..ed6fdffd265c8a53d87332d0853e6c98686c8a77 100644 (file)
@@ -551,7 +551,12 @@ brw_initialize_context_constants(struct brw_context *brw)
       ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 128;
    }
 
-   static const nir_shader_compiler_options nir_options = {
+   static const nir_shader_compiler_options gen4_nir_options = {
+      .native_integers = true,
+      .lower_ffma = true,
+   };
+
+   static const nir_shader_compiler_options gen6_nir_options = {
       .native_integers = true,
    };
 
@@ -568,7 +573,10 @@ brw_initialize_context_constants(struct brw_context *brw)
         (i == MESA_SHADER_FRAGMENT);
       ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectUniform = false;
       ctx->Const.ShaderCompilerOptions[i].LowerClipDistance = true;
-      ctx->Const.ShaderCompilerOptions[i].NirOptions = &nir_options;
+      if (brw->gen >= 6)
+         ctx->Const.ShaderCompilerOptions[i].NirOptions = &gen6_nir_options;
+      else
+         ctx->Const.ShaderCompilerOptions[i].NirOptions = &gen4_nir_options;
    }
 
    ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = true;