intel/blorp: Set additional brw_wm_prog_key fields on gen4-5
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 12 May 2017 19:03:47 +0000 (12:03 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 May 2017 14:58:01 +0000 (07:58 -0700)
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/blorp/blorp.c
src/intel/blorp/blorp_priv.h

index 1f29b93235be2c016c69e46c151d578c9cb56642..7f1566f00a4380995a044098a984969783cdea16 100644 (file)
@@ -153,7 +153,7 @@ brw_blorp_init_wm_prog_key(struct brw_wm_prog_key *wm_key)
 const unsigned *
 blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,
                  struct nir_shader *nir,
-                 const struct brw_wm_prog_key *wm_key,
+                 struct brw_wm_prog_key *wm_key,
                  bool use_repclear,
                  struct brw_wm_prog_data *wm_prog_data,
                  unsigned *program_size)
@@ -177,6 +177,13 @@ blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,
    nir_remove_dead_variables(nir, nir_var_shader_in);
    nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
 
+   if (blorp->compiler->devinfo->gen < 6) {
+      if (nir->info.fs.uses_discard)
+         wm_key->iz_lookup |= BRW_WM_IZ_PS_KILL_ALPHATEST_BIT;
+
+      wm_key->input_slots_valid = nir->info.inputs_read | VARYING_BIT_POS;
+   }
+
    const unsigned *program =
       brw_compile_fs(compiler, blorp->driver_ctx, mem_ctx, wm_key,
                      wm_prog_data, nir, NULL, -1, -1, false, use_repclear,
index b3a5b2b6dec8d55b6408971d0ac79c20ecaef5c5..99772308fe603d22036f0e643b73cd44ba5bf5c2 100644 (file)
@@ -333,7 +333,7 @@ void brw_blorp_init_wm_prog_key(struct brw_wm_prog_key *wm_key);
 const unsigned *
 blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,
                  struct nir_shader *nir,
-                 const struct brw_wm_prog_key *wm_key,
+                 struct brw_wm_prog_key *wm_key,
                  bool use_repclear,
                  struct brw_wm_prog_data *wm_prog_data,
                  unsigned *program_size);