i965: Move brw_dump_ir() out of brw_*_emit() functions
authorKristian Høgsberg Kristensen <krh@bitplanet.net>
Mon, 5 Oct 2015 20:58:05 +0000 (13:58 -0700)
committerKristian Høgsberg Kristensen <krh@bitplanet.net>
Thu, 8 Oct 2015 19:13:31 +0000 (12:13 -0700)
We move these calls one level up into the codegen functions.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
src/mesa/drivers/dri/i965/brw_cs.c
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_wm.c

index 6b64030a8689e7a00ffa369b036549176be53565..34680ee6e3ac8efc1b07c738845d0f1eadfc2bb2 100644 (file)
@@ -98,6 +98,9 @@ brw_codegen_cs_prog(struct brw_context *brw,
       start_time = get_time();
    }
 
+   if (unlikely(INTEL_DEBUG & DEBUG_CS))
+      brw_dump_ir("compute", prog, &cs->base, &cp->program.Base);
+
    program = brw_cs_emit(brw, mem_ctx, key, &prog_data,
                          &cp->program, prog, &program_size);
    if (program == NULL) {
index 781e2d8027b017780ed441784a561a2c396fa7fa..7c401535f886ab5a8ee70cc47690c64a8620b249 100644 (file)
@@ -5100,13 +5100,6 @@ brw_wm_fs_emit(struct brw_context *brw,
                struct gl_shader_program *prog,
                unsigned *final_assembly_size)
 {
-   struct brw_shader *shader = NULL;
-   if (prog)
-      shader = (brw_shader *) prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
-
-   if (unlikely(INTEL_DEBUG & DEBUG_WM))
-      brw_dump_ir("fragment", prog, &shader->base, &fp->Base);
-
    int st_index8 = -1, st_index16 = -1;
    if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
       st_index8 = brw_get_shader_time_index(brw, prog, &fp->Base, ST_FS8);
@@ -5224,12 +5217,6 @@ brw_cs_emit(struct brw_context *brw,
             struct gl_shader_program *prog,
             unsigned *final_assembly_size)
 {
-   struct brw_shader *shader =
-      (struct brw_shader *) prog->_LinkedShaders[MESA_SHADER_COMPUTE];
-
-   if (unlikely(INTEL_DEBUG & DEBUG_CS))
-      brw_dump_ir("compute", prog, &shader->base, &cp->Base);
-
    prog_data->local_size[0] = cp->LocalSize[0];
    prog_data->local_size[1] = cp->LocalSize[1];
    prog_data->local_size[2] = cp->LocalSize[2];
index f6b9874f78a25c194306ece11097f3a83c537470..26c91e4c76acea56ab8b6ac01c1cadfa276f5431 100644 (file)
@@ -291,6 +291,9 @@ brw_codegen_gs_prog(struct brw_context *brw,
     */
    c.prog_data.base.urb_read_length = (c.input_vue_map.num_slots + 1) / 2;
 
+   if (unlikely(INTEL_DEBUG & DEBUG_GS))
+      brw_dump_ir("geometry", prog, gs, NULL);
+
    void *mem_ctx = ralloc_context(NULL);
    unsigned program_size;
    const unsigned *program =
index 76ce0c46198bebbe33e286b10eefe45cc6af3eaa..4b4a216d5f5f998bc79750eb47e06a06e8602f58 100644 (file)
@@ -1947,17 +1947,10 @@ brw_vs_emit(struct brw_context *brw,
 {
    const unsigned *assembly = NULL;
 
-   struct brw_shader *shader = NULL;
-   if (prog)
-      shader = (brw_shader *) prog->_LinkedShaders[MESA_SHADER_VERTEX];
-
    int st_index = -1;
    if (INTEL_DEBUG & DEBUG_SHADER_TIME)
       st_index = brw_get_shader_time_index(brw, prog, &vp->Base, ST_VS);
 
-   if (unlikely(INTEL_DEBUG & DEBUG_VS))
-      brw_dump_ir("vertex", prog, &shader->base, &vp->Base);
-
    if (brw->intelScreen->compiler->scalar_vs) {
       prog_data->base.dispatch_mode = DISPATCH_MODE_SIMD8;
 
index f6967a74d4ef7a27ac7779e36f4d37c39125a4be..36ab25d1259142d89c21df7914f440b788e0ae6d 100644 (file)
@@ -622,9 +622,6 @@ brw_gs_emit(struct brw_context *brw,
 {
    struct gl_shader *shader = prog->_LinkedShaders[MESA_SHADER_GEOMETRY];
 
-   if (unlikely(INTEL_DEBUG & DEBUG_GS))
-      brw_dump_ir("geometry", prog, shader, NULL);
-
    int st_index = -1;
    if (INTEL_DEBUG & DEBUG_SHADER_TIME)
       st_index = brw_get_shader_time_index(brw, prog, NULL, ST_GS);
index 3c6ee0a7a03ba6e4ff611ac996bfb84ac42a5bb7..63d2e3f0f032541bb7dd81a41a4bb4cc7ffbf78f 100644 (file)
@@ -195,6 +195,9 @@ brw_codegen_vs_prog(struct brw_context *brw,
       start_time = get_time();
    }
 
+   if (unlikely(INTEL_DEBUG & DEBUG_VS))
+      brw_dump_ir("vertex", prog, &vs->base, &vp->program.Base);
+
    /* Emit GEN4 code.
     */
    program = brw_vs_emit(brw, mem_ctx, key, &prog_data,
index 98920463503e0ee954f8ce90480a4efde726e253..81a1d90bb602300634a5aac11dacca0e6a6b5eb1 100644 (file)
@@ -221,6 +221,9 @@ brw_codegen_wm_prog(struct brw_context *brw,
       start_time = get_time();
    }
 
+   if (unlikely(INTEL_DEBUG & DEBUG_WM))
+      brw_dump_ir("fragment", prog, &fs->base, &fp->program.Base);
+
    program = brw_wm_fs_emit(brw, mem_ctx, key, &prog_data,
                             &fp->program, prog, &program_size);
    if (program == NULL) {