mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 11:20:49 +02:00
i965/fs: Perform CSE on texture operations.
Helps Unigine Tropics and some (old) gstreamer shaders in shader-db. instructions in affected programs: 792 -> 744 (-6.06%) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
18372a7100
commit
35bc02dee8
1 changed files with 10 additions and 1 deletions
|
|
@ -103,7 +103,7 @@ is_expression(const fs_inst *const inst)
|
|||
case SHADER_OPCODE_LOAD_PAYLOAD:
|
||||
return !is_copy_payload(inst);
|
||||
default:
|
||||
return false;
|
||||
return inst->is_tex();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -153,6 +153,15 @@ instructions_match(fs_inst *a, fs_inst *b)
|
|||
a->conditional_mod == b->conditional_mod &&
|
||||
a->dst.type == b->dst.type &&
|
||||
a->sources == b->sources &&
|
||||
(a->is_tex() ? (a->texture_offset == b->texture_offset &&
|
||||
a->mlen == b->mlen &&
|
||||
a->regs_written == b->regs_written &&
|
||||
a->base_mrf == b->base_mrf &&
|
||||
a->sampler == b->sampler &&
|
||||
a->eot == b->eot &&
|
||||
a->header_present == b->header_present &&
|
||||
a->shadow_compare == b->shadow_compare)
|
||||
: true) &&
|
||||
operands_match(a, b);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue