[Mesa-dev] [PATCH 2/2] i965: Give compile stats through KHR_debug.
Matt Turner
mattst88 at gmail.com
Wed Dec 3 10:24:48 PST 2014
---
src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 10 ++++++++++
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index bbed4cc..4ae35ac 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -2035,6 +2035,16 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
ralloc_free(annotation.ann);
}
+ static GLuint msg_id = 0;
+ _mesa_gl_debug(&brw->ctx, &msg_id,
+ MESA_DEBUG_SOURCE_SHADER_COMPILER,
+ MESA_DEBUG_TYPE_OTHER,
+ MESA_DEBUG_SEVERITY_NOTIFICATION,
+ "FS SIMD%d shader: %d inst, %d loops, "
+ "compacted %d to %d bytes.\n",
+ dispatch_width, before_size / 16, loop_count,
+ before_size, after_size);
+
return start_offset;
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index b353539..e998bf2 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -1588,6 +1588,16 @@ vec4_generator::generate_code(const cfg_t *cfg)
dump_assembly(p->store, annotation.ann_count, annotation.ann, brw, prog);
ralloc_free(annotation.ann);
}
+
+ static GLuint msg_id = 0;
+ _mesa_gl_debug(&brw->ctx, &msg_id,
+ MESA_DEBUG_SOURCE_SHADER_COMPILER,
+ MESA_DEBUG_TYPE_OTHER,
+ MESA_DEBUG_SEVERITY_NOTIFICATION,
+ "VS vec4 shader: %d inst, %d loops, "
+ "compacted %d to %d bytes.\n",
+ before_size / 16, loop_count,
+ before_size, after_size);
}
const unsigned *
--
2.0.4
More information about the mesa-dev
mailing list