i965: Give compile stats through KHR_debug.
authorMatt Turner <mattst88@gmail.com>
Fri, 14 Nov 2014 20:46:44 +0000 (12:46 -0800)
committerMatt Turner <mattst88@gmail.com>
Sat, 6 Dec 2014 00:43:31 +0000 (16:43 -0800)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp

index b3229ef5b99cb2e059d133c4cee4e53f33ed996c..488528538ceb20f2e8e9336c35b3e67232ab832b 100644 (file)
@@ -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;
 }
 
index 74fd8c29f28862fd76598ec4956e88ce88401b8c..8d74ec7d887401a83316c3c8108e89b7d35c8ec0 100644 (file)
@@ -1593,6 +1593,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 *