+ next_binding_table_offset =
+ brw_assign_common_binding_table_offsets(devinfo, prog, &prog_data->base,
+ next_binding_table_offset);
+
+ if (prog->nir->info.outputs_read && !key->coherent_fb_fetch) {
+ prog_data->binding_table.render_target_read_start =
+ next_binding_table_offset;
+ next_binding_table_offset += key->nr_color_regions;
+ }
+}
+
+static void
+brw_wm_debug_recompile(struct brw_context *brw, struct gl_program *prog,
+ const struct brw_wm_prog_key *key)
+{
+ perf_debug("Recompiling fragment shader for program %d\n", prog->Id);
+
+ bool found = false;
+ const struct brw_wm_prog_key *old_key =
+ brw_find_previous_compile(&brw->cache, BRW_CACHE_FS_PROG,
+ key->program_string_id);
+
+ if (!old_key) {
+ perf_debug(" Didn't find previous compile in the shader cache for debug\n");
+ return;
+ }
+
+ found |= key_debug(brw, "alphatest, computed depth, depth test, or "
+ "depth write",
+ old_key->iz_lookup, key->iz_lookup);
+ found |= key_debug(brw, "depth statistics",
+ old_key->stats_wm, key->stats_wm);
+ found |= key_debug(brw, "flat shading",
+ old_key->flat_shade, key->flat_shade);
+ found |= key_debug(brw, "number of color buffers",
+ old_key->nr_color_regions, key->nr_color_regions);
+ found |= key_debug(brw, "MRT alpha test or alpha-to-coverage",
+ old_key->replicate_alpha, key->replicate_alpha);
+ found |= key_debug(brw, "fragment color clamping",
+ old_key->clamp_fragment_color, key->clamp_fragment_color);
+ found |= key_debug(brw, "per-sample interpolation",
+ old_key->persample_interp, key->persample_interp);
+ found |= key_debug(brw, "multisampled FBO",
+ old_key->multisample_fbo, key->multisample_fbo);
+ found |= key_debug(brw, "frag coord adds sample pos",
+ old_key->frag_coord_adds_sample_pos,
+ key->frag_coord_adds_sample_pos);
+ found |= key_debug(brw, "line smoothing",
+ old_key->line_aa, key->line_aa);
+ found |= key_debug(brw, "high quality derivatives",
+ old_key->high_quality_derivatives,
+ key->high_quality_derivatives);
+ found |= key_debug(brw, "force dual color blending",
+ old_key->force_dual_color_blend,
+ key->force_dual_color_blend);
+ found |= key_debug(brw, "coherent fb fetch",
+ old_key->coherent_fb_fetch, key->coherent_fb_fetch);
+
+ found |= key_debug(brw, "input slots valid",
+ old_key->input_slots_valid, key->input_slots_valid);
+ found |= key_debug(brw, "mrt alpha test function",
+ old_key->alpha_test_func, key->alpha_test_func);
+ found |= key_debug(brw, "mrt alpha test reference value",
+ old_key->alpha_test_ref, key->alpha_test_ref);
+
+ found |= brw_debug_recompile_sampler_key(brw, &old_key->tex, &key->tex);
+
+ if (!found) {
+ perf_debug(" Something else\n");
+ }