i965: Pull brw_compact_instructions() out of brw_get_program().
authorMatt Turner <mattst88@gmail.com>
Wed, 7 May 2014 18:53:22 +0000 (11:53 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 15 May 2014 22:45:40 +0000 (15:45 -0700)
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
src/mesa/drivers/dri/i965/brw_clip.c
src/mesa/drivers/dri/i965/brw_eu.c
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_sf.c
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp

index b6bb4b3ed1130e2e6d48c2ab51e537421e6dbdd5..9f0f5148d7b7093f75318bb2915703a34e1e094e 100644 (file)
@@ -489,6 +489,8 @@ brw_blorp_const_color_program::compile(struct brw_context *brw,
       brw_dump_compile(&func, stderr, 0, func.next_insn_offset);
       fprintf(stderr, "\n");
    }
+
+   brw_compact_instructions(&func);
    return brw_get_program(&func, program_size);
 }
 
index d1815f2216e7d58b1737ba1d002341d71750b40c..1c54b918d73cf323334a1a732ad3425d37396c63 100644 (file)
@@ -111,7 +111,7 @@ static void compile_clip_prog( struct brw_context *brw,
       return;
    }
 
-       
+   brw_compact_instructions(&c.func);
 
    /* get the program
     */
index 15105c2944c1673c3e75fa9c9f659e0f1980acd7..d8a35435a7e40a335125085a86dce8bfca429ca2 100644 (file)
@@ -249,8 +249,6 @@ brw_init_compile(struct brw_context *brw, struct brw_compile *p, void *mem_ctx)
 const unsigned *brw_get_program( struct brw_compile *p,
                               unsigned *sz )
 {
-   brw_compact_instructions(p);
-
    *sz = p->next_insn_offset;
    return (const unsigned *)p->store;
 }
index ff85171bb618e628da475c1023ef4bb3f9147a71..a9a16ee6ba3eb30d551b2d4945746c47926899c3 100644 (file)
@@ -1852,15 +1852,10 @@ fs_generator::generate_assembly(exec_list *simd8_instructions,
    if (simd8_instructions) {
       dispatch_width = 8;
       generate_code(simd8_instructions, dump_file);
+      brw_compact_instructions(p);
    }
 
    if (simd16_instructions) {
-      /* We have to do a compaction pass now, or the one at the end of
-       * execution will squash down where our prog_offset start needs
-       * to be.
-       */
-      brw_compact_instructions(p);
-
       /* align to 64 byte boundary. */
       while ((p->nr_insn * sizeof(struct brw_instruction)) % 64) {
          brw_NOP(p);
@@ -1873,6 +1868,7 @@ fs_generator::generate_assembly(exec_list *simd8_instructions,
 
       dispatch_width = 16;
       generate_code(simd16_instructions, dump_file);
+      brw_compact_instructions(p);
    }
 
    return brw_get_program(p, assembly_size);
index 866d2988e37c8ccd7ce903a86e74db02f8bb5a3d..eaa527f778ffe694c7f735b426c02d5399c28696 100644 (file)
@@ -128,6 +128,8 @@ static void compile_ff_gs_prog(struct brw_context *brw,
       }
    }
 
+   brw_compact_instructions(&c.func);
+
    /* get the program
     */
    program = brw_get_program(&c.func, &program_size);
index 61d308a3f8df3fd9b800576a58afcb6a5a6331d9..401fa7bf45a435d89ff3c7c737a4a7547245ed3d 100644 (file)
@@ -110,6 +110,8 @@ static void compile_sf_prog( struct brw_context *brw,
       return;
    }
 
+   brw_compact_instructions(&c.func);
+
    /* get the program
     */
    program = brw_get_program(&c.func, &program_size);
index bcacde92dd1b179a587252ff9d7c3973c7050b7b..305a94c96fca83d5e51eee604d03916e7815a214 100644 (file)
@@ -1363,6 +1363,7 @@ vec4_generator::generate_assembly(exec_list *instructions,
 {
    brw_set_access_mode(p, BRW_ALIGN_16);
    generate_code(instructions);
+   brw_compact_instructions(p);
    return brw_get_program(p, assembly_size);
 }