summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-07-18 09:15:15 -0500
committerJason Ekstrand <[email protected]>2019-07-29 23:30:26 +0000
commite401303597ae9c6ab5f538f14847dd463b455dd1 (patch)
treea77683ff6e43aca4f4c012f1afb5629510810de5
parent010d255656d21dbac80c3bfbddcd4dbc92faa988 (diff)
intel/fs: Remove calculate_urb_setup from fs_visitor
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/intel/compiler/brw_fs.cpp21
-rw-r--r--src/intel/compiler/brw_fs.h1
2 files changed, 8 insertions, 14 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 9a29c3ae702..493b9fdf8bb 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -1616,13 +1616,12 @@ fs_visitor::assign_curb_setup()
this->first_non_payload_grf = payload.num_regs + prog_data->curb_read_length;
}
-void
-fs_visitor::calculate_urb_setup()
+static void
+calculate_urb_setup(const struct gen_device_info *devinfo,
+ const struct brw_wm_prog_key *key,
+ struct brw_wm_prog_data *prog_data,
+ const nir_shader *nir)
{
- assert(stage == MESA_SHADER_FRAGMENT);
- struct brw_wm_prog_data *prog_data = brw_wm_prog_data(this->prog_data);
- brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
-
memset(prog_data->urb_setup, -1,
sizeof(prog_data->urb_setup[0]) * VARYING_SLOT_MAX);
@@ -7601,7 +7600,6 @@ fs_visitor::run_fs(bool allow_spilling, bool do_rep_send)
if (shader_time_index >= 0)
emit_shader_time_begin();
- calculate_urb_setup();
if (nir->info.inputs_read > 0 ||
(nir->info.outputs_read > 0 && !wm_key->coherent_fb_fetch)) {
if (devinfo->gen < 6)
@@ -8007,6 +8005,9 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
prog_data->barycentric_interp_modes =
brw_compute_barycentric_interp_modes(compiler->devinfo, shader);
+ calculate_urb_setup(devinfo, key, prog_data, shader);
+ brw_compute_flat_inputs(prog_data, shader);
+
cfg_t *simd8_cfg = NULL, *simd16_cfg = NULL, *simd32_cfg = NULL;
fs_visitor v8(compiler, log_data, mem_ctx, &key->base,
@@ -8108,12 +8109,6 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
simd16_cfg = NULL;
}
- /* We have to compute the flat inputs after the visitor is finished running
- * because it relies on prog_data->urb_setup which is computed in
- * fs_visitor::calculate_urb_setup().
- */
- brw_compute_flat_inputs(prog_data, shader);
-
fs_generator g(compiler, log_data, mem_ctx, &prog_data->base,
v8.promoted_constants, v8.runtime_check_aads_emit,
MESA_SHADER_FRAGMENT);
diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h
index 2eb49dd5ace..e0e337d46c0 100644
--- a/src/intel/compiler/brw_fs.h
+++ b/src/intel/compiler/brw_fs.h
@@ -104,7 +104,6 @@ public:
bool fixup_sends_duplicate_payload();
void fixup_3src_null_dest();
void assign_curb_setup();
- void calculate_urb_setup();
void assign_urb_setup();
void convert_attr_sources_to_hw_regs(fs_inst *inst);
void assign_vs_urb_setup();