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"); } }
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_CACHE_VS_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; } 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, "legacy user clipping", old_key->nr_userclip_plane_consts, key->nr_userclip_plane_consts); 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->clamp_vertex_color, key->clamp_vertex_color); found |= brw_debug_recompile_sampler_key(brw, &old_key->tex, &key->tex); if (!found) { perf_debug(" Something else\n"); } }
bool brw_debug_recompile_sampler_key(struct brw_context *brw, const struct brw_sampler_prog_key_data *old_key, const struct brw_sampler_prog_key_data *key) { bool found = false; for (unsigned int i = 0; i < MAX_SAMPLERS; i++) { found |= key_debug(brw, "EXT_texture_swizzle or DEPTH_TEXTURE_MODE", old_key->swizzles[i], key->swizzles[i]); } found |= key_debug(brw, "GL_CLAMP enabled on any texture unit's 1st coordinate", old_key->gl_clamp_mask[0], key->gl_clamp_mask[0]); found |= key_debug(brw, "GL_CLAMP enabled on any texture unit's 2nd coordinate", old_key->gl_clamp_mask[1], key->gl_clamp_mask[1]); found |= key_debug(brw, "GL_CLAMP enabled on any texture unit's 3rd coordinate", old_key->gl_clamp_mask[2], key->gl_clamp_mask[2]); found |= key_debug(brw, "gather channel quirk on any texture unit", old_key->gather_channel_quirk_mask, key->gather_channel_quirk_mask); found |= key_debug(brw, "compressed multisample layout", old_key->compressed_multisample_layout_mask, key->compressed_multisample_layout_mask); found |= key_debug(brw, "16x msaa", old_key->msaa_16, key->msaa_16); for (unsigned int i = 0; i < MAX_SAMPLERS; i++) { found |= key_debug(brw, "textureGather workarounds", old_key->gen6_gather_wa[i], key->gen6_gather_wa[i]); } return found; }
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"); } }
bool brw_debug_recompile_sampler_key(struct brw_context *brw, const struct brw_sampler_prog_key_data *old_key, const struct brw_sampler_prog_key_data *key) { bool found = false; for (unsigned int i = 0; i < MAX_SAMPLERS; i++) { found |= key_debug(brw, "EXT_texture_swizzle or DEPTH_TEXTURE_MODE", old_key->swizzles[i], key->swizzles[i]); } found |= key_debug(brw, "GL_CLAMP enabled on any texture unit's 1st coordinate", old_key->gl_clamp_mask[0], key->gl_clamp_mask[0]); found |= key_debug(brw, "GL_CLAMP enabled on any texture unit's 2nd coordinate", old_key->gl_clamp_mask[1], key->gl_clamp_mask[1]); found |= key_debug(brw, "GL_CLAMP enabled on any texture unit's 3rd coordinate", old_key->gl_clamp_mask[2], key->gl_clamp_mask[2]); found |= key_debug(brw, "GL_MESA_ycbcr texturing\n", old_key->yuvtex_mask, key->yuvtex_mask); found |= key_debug(brw, "GL_MESA_ycbcr UV swapping\n", old_key->yuvtex_swap_mask, key->yuvtex_swap_mask); found |= key_debug(brw, "gather channel quirk on any texture unit", old_key->gather_channel_quirk_mask, key->gather_channel_quirk_mask); return found; }
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->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; } for (unsigned int i = 0; i < VERT_ATTRIB_MAX; i++) { found |= key_debug("GL_FIXED rescaling", old_key->gl_fixed_input_size[i], key->gl_fixed_input_size[i]); } found |= key_debug("user clip flags", old_key->userclip_active, key->userclip_active); found |= key_debug("user clipping planes as push constants", old_key->nr_userclip_plane_consts, key->nr_userclip_plane_consts); found |= key_debug("clip distance enable", old_key->uses_clip_distance, key->uses_clip_distance); found |= key_debug("clip plane enable bitfield", old_key->userclip_planes_enabled_gen_4_5, key->userclip_planes_enabled_gen_4_5); found |= key_debug("copy edgeflag", old_key->copy_edgeflag, key->copy_edgeflag); found |= key_debug("PointCoord replace", old_key->point_coord_replace, key->point_coord_replace); found |= key_debug("vertex color clamping", old_key->clamp_vertex_color, key->clamp_vertex_color); found |= brw_debug_recompile_sampler_key(&old_key->tex, &key->tex); if (!found) { perf_debug(" Something else\n"); } }