intel: Add a batch flush between front-buffer downsample and X protocol.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs_cse.cpp
index 5a50d45ddc981ed847c25a5ad55b61d98507ba81..e715c3767b9ef1b41c0c0ff2ad4f9b8881a12abe 100644 (file)
@@ -69,6 +69,7 @@ is_expression(const fs_inst *const inst)
    case BRW_OPCODE_LRP:
    case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD:
    case FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN7:
+   case FS_OPCODE_VARYING_PULL_CONSTANT_LOAD:
    case FS_OPCODE_CINTERP:
    case FS_OPCODE_LINTERP:
       return true;
@@ -96,8 +97,9 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
        inst = (fs_inst *) inst->next) {
 
       /* Skip some cases. */
-      if (is_expression(inst) && !inst->predicate && inst->mlen == 0 &&
-          !inst->force_uncompressed && !inst->force_sechalf &&
+      if (is_expression(inst) &&
+          !inst->predicate &&
+          !inst->is_partial_write() &&
           !inst->conditional_mod)
       {
         bool found = false;
@@ -130,7 +132,7 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
             */
            bool no_existing_temp = entry->tmp.file == BAD_FILE;
            if (no_existing_temp) {
-               int written = entry->generator->regs_written();
+               int written = entry->generator->regs_written;
 
                fs_reg orig_dst = entry->generator->dst;
                fs_reg tmp = fs_reg(GRF, virtual_grf_alloc(written),
@@ -150,8 +152,8 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
            }
 
            /* dest <- temp */
-            int written = inst->regs_written();
-            assert(written == entry->generator->regs_written());
+            int written = inst->regs_written;
+            assert(written == entry->generator->regs_written);
             assert(inst->dst.type == entry->tmp.type);
             fs_reg dst = inst->dst;
             fs_reg tmp = entry->tmp;
@@ -194,7 +196,7 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
             /* Kill any AEB entries using registers that don't get reused any
              * more -- a sure sign they'll fail operands_match().
              */
-            if (src_reg->file == GRF && virtual_grf_use[src_reg->reg] < ip) {
+            if (src_reg->file == GRF && virtual_grf_end[src_reg->reg] < ip) {
                entry->remove();
                ralloc_free(entry);
               break;