i965: Replace brw_setup_tex_for_precompile brw with devinfo
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 1 Mar 2018 01:14:50 +0000 (17:14 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 10 Jul 2018 06:02:33 +0000 (23:02 -0700)
Trying to make sure the setup of the default program key is not
dependent on the GL state.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/drivers/dri/i965/brw_cs.c
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/brw_program.h
src/mesa/drivers/dri/i965/brw_tcs.c
src/mesa/drivers/dri/i965/brw_tes.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_wm.c

index e3f8fc67a4b2b53da5f18a091d33802405a41993..9b1b0832b5a381029d0a0952d6334645de70099b 100644 (file)
@@ -196,7 +196,7 @@ brw_cs_precompile(struct gl_context *ctx, struct gl_program *prog)
    memset(&key, 0, sizeof(key));
    key.program_string_id = bcp->id;
 
-   brw_setup_tex_for_precompile(brw, &key.tex, prog);
+   brw_setup_tex_for_precompile(&brw->screen->devinfo, &key.tex, prog);
 
    uint32_t old_prog_offset = brw->cs.base.prog_offset;
    struct brw_stage_prog_data *old_prog_data = brw->cs.base.prog_data;
index f74ee178f25b056badf1bb827ec20e1c7720a9af..f488fab009ec2354719ce0fd4abc4cf7dfaa8fcf 100644 (file)
@@ -221,7 +221,7 @@ brw_gs_precompile(struct gl_context *ctx, struct gl_program *prog)
 
    memset(&key, 0, sizeof(key));
 
-   brw_setup_tex_for_precompile(brw, &key.tex, prog);
+   brw_setup_tex_for_precompile(&brw->screen->devinfo, &key.tex, prog);
    key.program_string_id = bgp->id;
 
    success = brw_codegen_gs_prog(brw, bgp, &key);
index 7f0b7133f5425d812c6708974d1bd4096abc2afe..4dd27d84676bb903e6fe8761bca1bec39812e12e 100644 (file)
@@ -739,11 +739,10 @@ brw_dump_arb_asm(const char *stage, struct gl_program *prog)
 }
 
 void
-brw_setup_tex_for_precompile(struct brw_context *brw,
+brw_setup_tex_for_precompile(const struct gen_device_info *devinfo,
                              struct brw_sampler_prog_key_data *tex,
                              struct gl_program *prog)
 {
-   const struct gen_device_info *devinfo = &brw->screen->devinfo;
    const bool has_shader_channel_select = devinfo->is_haswell || devinfo->gen >= 8;
    unsigned sampler_count = util_last_bit(prog->SamplersUsed);
    for (unsigned i = 0; i < sampler_count; i++) {
index 3cdb90264ad4e87a588c9486ce79047e560b41f0..c8656fcff1fadf2a38c2ab013371487896b7f607 100644 (file)
@@ -66,7 +66,7 @@ struct nir_shader *brw_create_nir(struct brw_context *brw,
 
 void brw_shader_gather_info(nir_shader *nir, struct gl_program *prog);
 
-void brw_setup_tex_for_precompile(struct brw_context *brw,
+void brw_setup_tex_for_precompile(const struct gen_device_info *devinfo,
                                   struct brw_sampler_prog_key_data *tex,
                                   struct gl_program *prog);
 
index 931ef64166c9f4403abbccfbdce3c8de087fd744..70313fee8ac8f3c7c933c2d1768e4a8c62b6f077 100644 (file)
@@ -374,7 +374,7 @@ brw_tcs_precompile(struct gl_context *ctx,
    memset(&key, 0, sizeof(key));
 
    key.program_string_id = btcp->id;
-   brw_setup_tex_for_precompile(brw, &key.tex, prog);
+   brw_setup_tex_for_precompile(&brw->screen->devinfo, &key.tex, prog);
 
    /* Guess that the input and output patches have the same dimensionality. */
    if (devinfo->gen < 8)
index 2f3697ce9617d988d23d0d30bbbc5113997a01b7..72b218ac14f750668315c6e37a0dd9e6fefe4598 100644 (file)
@@ -239,7 +239,7 @@ brw_tes_precompile(struct gl_context *ctx,
       key.patch_inputs_read |= tcp->nir->info.patch_outputs_written;
    }
 
-   brw_setup_tex_for_precompile(brw, &key.tex, prog);
+   brw_setup_tex_for_precompile(&brw->screen->devinfo, &key.tex, prog);
 
    success = brw_codegen_tes_prog(brw, btep, &key);
 
index 5154dee3ca3e927b8daffdd98c9bad2d9b177c5f..f024c33c02d56fa410a0eaf037dd0ef7f64fb758 100644 (file)
@@ -369,7 +369,7 @@ brw_vs_precompile(struct gl_context *ctx, struct gl_program *prog)
 
    memset(&key, 0, sizeof(key));
 
-   brw_setup_tex_for_precompile(brw, &key.tex, prog);
+   brw_setup_tex_for_precompile(&brw->screen->devinfo, &key.tex, prog);
    key.program_string_id = bvp->id;
    key.clamp_vertex_color =
       (prog->info.outputs_written &
index cc6eaae1a8491b555352d3ab9b86c28b56d81ef2..0fda9c5069d32e29bf1cdfa31c7844f7b670f855 100644 (file)
@@ -637,7 +637,7 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_program *prog)
       key.input_slots_valid = prog->info.inputs_read | VARYING_BIT_POS;
    }
 
-   brw_setup_tex_for_precompile(brw, &key.tex, prog);
+   brw_setup_tex_for_precompile(&brw->screen->devinfo, &key.tex, prog);
 
    key.nr_color_regions = _mesa_bitcount_64(outputs_written &
          ~(BITFIELD64_BIT(FRAG_RESULT_DEPTH) |