diff options
author | Ilia Mirkin <[email protected]> | 2017-06-24 17:09:20 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2017-06-26 20:24:19 -0400 |
commit | 7d56ae5eb2e32e88c90261d6782890ce0c524e7d (patch) | |
tree | 56fdd21fabdd72c86587d853084d7c39069cefc6 /src/gallium/drivers/nouveau | |
parent | 55a8c117051406ff80166d365e832ff99b90d1a8 (diff) |
nv50/ir: adjust overlapping logic to take fileIndex-relative offsets
If the fileIndex is different, that means they are in logically
different spaces. However if there's also a relative offset, then they
could end up pointing at the same spot again.
Also add a note about potential for multiple buffers to overlap even if
they're at different file indexes. However that's potentially lowered
away by the point that this logic hits.
Not known to fix any specific application or test.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index c6dbd4fead4..7c4420682a7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -2779,11 +2779,15 @@ MemoryOpt::Record::overlaps(const Instruction *ldst) const Record that; that.set(ldst); - if (this->fileIndex != that.fileIndex) + // This assumes that images/buffers can't overlap. They can. + // TODO: Plumb the restrict logic through, and only skip when it's a + // restrict situation, or there can implicitly be no writes. + if (this->fileIndex != that.fileIndex && this->rel[1] == that.rel[1]) return false; if (this->rel[0] || that.rel[0]) return this->base == that.base; + return (this->offset < that.offset + that.size) && (this->offset + this->size > that.offset); |