summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2016-03-26 22:32:43 -0400
committerEmil Velikov <emil.l.velikov@gmail.com>2016-04-14 22:35:05 +0100
commit75afb4ca6e053983d3537a4fff01ddb4bceb8871 (patch)
treeac4367e2874ff4c9fe7ea64c8e6217d941a167c7
parenta785cccc706feeaba16e3df0b41bc4548c9be2b4 (diff)
downloadmesa-75afb4ca6e053983d3537a4fff01ddb4bceb8871.tar.gz
nvc0: disable primitive restart and index bias during blits
Back in the dawn of time, we used to do immediate uploads for the vertex data, and all was well. However Maxwell dropped support for immediate vertex data, so we started feeding in a VBO (in all cases). But we forgot to disable some things that apply in such cases, specifically primitive restart and index bias. The latter was causing WoW and other Blizzard games trouble as they use a pattern where they draw with a base vertex (aka index bias), followed by texture uploads (aka blits, internally). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91526 Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Tested-by: Karol Herbst <nouveau@karolherbst.de> (cherry picked from commit 41100b6b44e747b9003937f123fce571fd3dec46)
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_surface.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index 8f154b8ea7e..1613d47fa77 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -1294,6 +1294,17 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
}
nvc0->state.num_vtxelts = 2;
+ if (nvc0->state.prim_restart) {
+ IMMED_NVC0(push, NVC0_3D(PRIM_RESTART_ENABLE), 0);
+ nvc0->state.prim_restart = 0;
+ }
+
+ if (nvc0->state.index_bias) {
+ IMMED_NVC0(push, NVC0_3D(VB_ELEMENT_BASE), 0);
+ IMMED_NVC0(push, NVC0_3D(VERTEX_ID_BASE), 0);
+ nvc0->state.index_bias = 0;
+ }
+
for (i = 0; i < info->dst.box.depth; ++i, z += dz) {
if (info->dst.box.z + i) {
BEGIN_NVC0(push, NVC0_3D(LAYER), 1);