i965/vs: Include URB payload setup in shader_time.
authorEric Anholt <eric@anholt.net>
Tue, 19 Mar 2013 23:28:54 +0000 (16:28 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 28 Mar 2013 18:46:41 +0000 (11:46 -0700)
This much more accurately reflects the cost of the vertex shader, since
the payload setup is often a significant fraction of the instructions in
the VS.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index a40a0b475700fe279220c69bbd85fb80ae84f09a..9308ed61041857456fa156531b950a9c7b1a5be9 100644 (file)
@@ -1303,9 +1303,6 @@ vec4_visitor::run()
    if (c->key.userclip_active && !c->key.uses_clip_distance)
       setup_uniform_clipplane_values();
 
-   if (INTEL_DEBUG & DEBUG_SHADER_TIME)
-      emit_shader_time_end();
-
    emit_urb_writes();
 
    /* Before any optimization, push array accesses out to scratch
index d3ca06fefc2dcc1d66ce4c9072ecd09cd7d9df21..3229d82082649fd763e3abf5ac40004ec3cca813 100644 (file)
@@ -2638,11 +2638,16 @@ vec4_visitor::emit_urb_writes()
       }
    }
 
+   bool eot = slot >= c->prog_data.vue_map.num_slots;
+   if (eot) {
+      if (INTEL_DEBUG & DEBUG_SHADER_TIME)
+         emit_shader_time_end();
+   }
    current_annotation = "URB write";
    vec4_instruction *inst = emit(VS_OPCODE_URB_WRITE);
    inst->base_mrf = base_mrf;
    inst->mlen = align_interleaved_urb_mlen(brw, mrf - base_mrf);
-   inst->eot = (slot >= c->prog_data.vue_map.num_slots);
+   inst->eot = eot;
 
    /* Optional second URB write */
    if (!inst->eot) {
@@ -2654,6 +2659,11 @@ vec4_visitor::emit_urb_writes()
          emit_urb_slot(mrf++, c->prog_data.vue_map.slot_to_varying[slot]);
       }
 
+      if (eot) {
+         if (INTEL_DEBUG & DEBUG_SHADER_TIME)
+            emit_shader_time_end();
+      }
+
       current_annotation = "URB write";
       inst = emit(VS_OPCODE_URB_WRITE);
       inst->base_mrf = base_mrf;