void brw_vs_debug_recompile(struct brw_context *brw, struct gl_shader_program *prog, const struct brw_vs_prog_key *key) { struct brw_cache_item *c = NULL; const struct brw_vs_prog_key *old_key = NULL; bool found = false; perf_debug("Recompiling vertex shader for program %d\n", prog->Name); for (unsigned int i = 0; i < brw->cache.size; i++) { for (c = brw->cache.items[i]; c; c = c->next) { if (c->cache_id == BRW_VS_PROG) { old_key = c->key; if (old_key->base.program_string_id == key->base.program_string_id) break; } } if (c) break; } if (!c) { perf_debug(" Didn't find previous compile in the shader cache for " "debug\n"); return; } for (unsigned int i = 0; i < VERT_ATTRIB_MAX; i++) { found |= key_debug(brw, "Vertex attrib w/a flags", old_key->gl_attrib_wa_flags[i], key->gl_attrib_wa_flags[i]); } found |= key_debug(brw, "user clip flags", old_key->base.userclip_active, key->base.userclip_active); found |= key_debug(brw, "user clipping planes as push constants", old_key->base.nr_userclip_plane_consts, key->base.nr_userclip_plane_consts); found |= key_debug(brw, "clip distance enable", old_key->base.uses_clip_distance, key->base.uses_clip_distance); found |= key_debug(brw, "copy edgeflag", old_key->copy_edgeflag, key->copy_edgeflag); found |= key_debug(brw, "PointCoord replace", old_key->point_coord_replace, key->point_coord_replace); found |= key_debug(brw, "vertex color clamping", old_key->base.clamp_vertex_color, key->base.clamp_vertex_color); found |= brw_debug_recompile_sampler_key(brw, &old_key->base.tex, &key->base.tex); if (!found) { perf_debug(" Something else\n"); } }
void brw_wm_debug_recompile(struct brw_context *brw, struct gl_shader_program *prog, const struct brw_wm_prog_key *key) { struct brw_cache_item *c = NULL; const struct brw_wm_prog_key *old_key = NULL; bool found = false; perf_debug("Recompiling fragment shader for program %d\n", prog->Name); for (unsigned int i = 0; i < brw->cache.size; i++) { for (c = brw->cache.items[i]; c; c = c->next) { if (c->cache_id == BRW_WM_PROG) { old_key = c->key; if (old_key->program_string_id == key->program_string_id) break; } } if (c) break; } if (!c) { 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, "rendering to FBO", old_key->render_to_fbo, key->render_to_fbo); found |= key_debug(brw, "fragment color clamping", old_key->clamp_fragment_color, key->clamp_fragment_color); found |= key_debug(brw, "line smoothing", old_key->line_aa, key->line_aa); found |= key_debug(brw, "renderbuffer height", old_key->drawable_height, key->drawable_height); found |= key_debug(brw, "input slots valid", old_key->input_slots_valid, key->input_slots_valid); found |= brw_debug_recompile_sampler_key(brw, &old_key->tex, &key->tex); if (!found) { perf_debug(" Something else\n"); } }
static void brw_tcs_debug_recompile(struct brw_context *brw, struct gl_shader_program *shader_prog, const struct brw_tcs_prog_key *key) { struct brw_cache_item *c = NULL; const struct brw_tcs_prog_key *old_key = NULL; bool found = false; perf_debug("Recompiling tessellation control shader for program %d\n", shader_prog->Name); for (unsigned int i = 0; i < brw->cache.size; i++) { for (c = brw->cache.items[i]; c; c = c->next) { if (c->cache_id == BRW_CACHE_TCS_PROG) { old_key = c->key; if (old_key->program_string_id == key->program_string_id) break; } } if (c) break; } if (!c) { perf_debug(" Didn't find previous compile in the shader cache for " "debug\n"); return; } found |= key_debug(brw, "input vertices", old_key->input_vertices, key->input_vertices); found |= key_debug(brw, "outputs written", old_key->outputs_written, key->outputs_written); found |= key_debug(brw, "patch outputs written", old_key->patch_outputs_written, key->patch_outputs_written); found |= key_debug(brw, "TES primitive mode", old_key->tes_primitive_mode, key->tes_primitive_mode); found |= key_debug(brw, "quads and equal_spacing workaround", old_key->quads_workaround, key->quads_workaround); found |= brw_debug_recompile_sampler_key(brw, &old_key->tex, &key->tex); if (!found) { perf_debug(" Something else\n"); } }
static void brw_gs_debug_recompile(struct brw_context *brw, struct gl_program *prog, const struct brw_gs_prog_key *key) { perf_debug("Recompiling geometry shader for program %d\n", prog->Id); bool found = false; const struct brw_gs_prog_key *old_key = brw_find_previous_compile(&brw->cache, BRW_CACHE_GS_PROG, key->program_string_id); if (!old_key) { perf_debug(" Didn't find previous compile in the shader cache for " "debug\n"); return; } found |= brw_debug_recompile_sampler_key(brw, &old_key->tex, &key->tex); if (!found) { perf_debug(" Something else\n"); } }
static void brw_gs_debug_recompile(struct brw_context *brw, struct gl_shader_program *shader_prog, const struct brw_gs_prog_key *key) { struct brw_cache_item *c = NULL; const struct brw_gs_prog_key *old_key = NULL; bool found = false; perf_debug("Recompiling geometry shader for program %d\n", shader_prog->Name); for (unsigned int i = 0; i < brw->cache.size; i++) { for (c = brw->cache.items[i]; c; c = c->next) { if (c->cache_id == BRW_CACHE_GS_PROG) { old_key = c->key; if (old_key->program_string_id == key->program_string_id) break; } } if (c) break; } if (!c) { perf_debug(" Didn't find previous compile in the shader cache for " "debug\n"); return; } found |= brw_debug_recompile_sampler_key(brw, &old_key->tex, &key->tex); if (!found) { perf_debug(" Something else\n"); } }