summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2018-09-16 21:59:55 +0200
committerAxel Davy <[email protected]>2018-09-25 22:05:24 +0200
commitdc4b53e129150e85903214fc7cdd3cd437843392 (patch)
tree5eab5231c730044cef30ded0b8aa38f25de18057
parent0eeb583650c64e789e0bfa7b3194310c5c44ba4f (diff)
st/nine: Lock the entire buffer in some cases.
Previously we had already found that for MANAGED buffers the buffer started dirty (which meant all writes out of bound before the first draw call using the buffer have to be taken into account). Possibly it is the same for the other types of buffers. For now always lock the entire buffer (starting from the offset) for these (except for DYNAMIC buffers, which might hurt performance too much). Fixes: https://github.com/iXit/Mesa-3D/issues/301 Signed-off-by: Axel Davy <[email protected]>
-rw-r--r--src/gallium/state_trackers/nine/buffer9.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/buffer9.c b/src/gallium/state_trackers/nine/buffer9.c
index 69b08e8c10e..5880ee3c1a2 100644
--- a/src/gallium/state_trackers/nine/buffer9.c
+++ b/src/gallium/state_trackers/nine/buffer9.c
@@ -231,6 +231,14 @@ NineBuffer9_Lock( struct NineBuffer9 *This,
user_warn(OffsetToLock != 0);
}
+ /* Write out of bound seems to have to be taken into account for these.
+ * TODO: Do more tests (is it only at buffer first lock ? etc).
+ * Since these buffers are supposed to be locked once and never
+ * writen again (MANAGED or DYNAMIC is used for the other uses cases),
+ * performance should be unaffected. */
+ if (!(This->base.usage & D3DUSAGE_DYNAMIC) && This->base.pool != D3DPOOL_MANAGED)
+ SizeToLock = This->size - OffsetToLock;
+
u_box_1d(OffsetToLock, SizeToLock, &box);
if (This->base.pool == D3DPOOL_MANAGED) {