From e9efd667defe13c89881f138cb5719c72573ff73 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 15 Apr 2015 01:57:52 -0700 Subject: i965: Make shader_time use 0 instead of -1 for "no meaningful ID". 0 is not a valid GLSL shader or ARB program ID. For some reason, shader_time used -1 instead...so we had code to detect 0, then override it to -1. We can just delete that. Signed-off-by: Kenneth Graunke Reviewed-by: Jason Ekstrand Reviewed-by: Anuj Phogat --- src/mesa/drivers/dri/i965/brw_program.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index 9e27c2aa974..0ca63de0cf9 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -346,7 +346,7 @@ print_shader_time_line(const char *stage, const char *name, { fprintf(stderr, "%-6s%-18s", stage, name); - if (shader_num != -1) + if (shader_num != 0) fprintf(stderr, "%4d: ", shader_num); else fprintf(stderr, " : "); @@ -443,7 +443,7 @@ brw_report_shader_time(struct brw_context *brw) if (scaled[i] == 0) continue; - int shader_num = -1; + int shader_num = 0; if (prog) { shader_num = prog->Name; @@ -456,7 +456,6 @@ brw_report_shader_time(struct brw_context *brw) (brw->shader_time.types[i] == ST_FS8 || brw->shader_time.types[i] == ST_FS16)) { shader_name = "ff"; - shader_num = -1; } else { shader_name = "glsl"; } @@ -464,7 +463,6 @@ brw_report_shader_time(struct brw_context *brw) shader_num = brw->shader_time.programs[i]->Id; if (shader_num == 0) { shader_name = "ff"; - shader_num = -1; } else { shader_name = "prog"; } @@ -495,10 +493,10 @@ brw_report_shader_time(struct brw_context *brw) } fprintf(stderr, "\n"); - print_shader_time_line("total", "vs", -1, total_by_type[ST_VS], total); - print_shader_time_line("total", "gs", -1, total_by_type[ST_GS], total); - print_shader_time_line("total", "fs8", -1, total_by_type[ST_FS8], total); - print_shader_time_line("total", "fs16", -1, total_by_type[ST_FS16], total); + print_shader_time_line("total", "vs", 0, total_by_type[ST_VS], total); + print_shader_time_line("total", "gs", 0, total_by_type[ST_GS], total); + print_shader_time_line("total", "fs8", 0, total_by_type[ST_FS8], total); + print_shader_time_line("total", "fs16", 0, total_by_type[ST_FS16], total); } static void -- cgit v1.2.3