OSDN Git Service

i965: Clarify check for which cache to use on Gen6 data port reads.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 8 Oct 2011 04:45:34 +0000 (21:45 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 18 Oct 2011 22:57:55 +0000 (15:57 -0700)
Currently, we use the Render Cache for scratch access (read/write data)
and the Sampler Cache for all read only data (pull constants).

Reversing the condition here is clearer: if the caller requested the
Render Cache, use that.  Otherwise, they requested the Data Cache
(which does not exist on Gen6) or Sampler Cache, so use the Sampler
Cache.

This should not change behavior in any way.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 7f6ed68..7773cff 100644 (file)
@@ -626,10 +626,10 @@ brw_set_dp_read_message(struct brw_compile *p,
    } else if (intel->gen == 6) {
       uint32_t target_function;
 
-      if (target_cache == BRW_DATAPORT_READ_TARGET_DATA_CACHE)
-        target_function = GEN6_MESSAGE_TARGET_DP_SAMPLER_CACHE;
-      else
+      if (target_cache == BRW_DATAPORT_READ_TARGET_RENDER_CACHE)
         target_function = GEN6_MESSAGE_TARGET_DP_RENDER_CACHE;
+      else
+        target_function = GEN6_MESSAGE_TARGET_DP_SAMPLER_CACHE;
 
       insn->bits3.gen6_dp.binding_table_index = binding_table_index;
       insn->bits3.gen6_dp.msg_control = msg_control;