OSDN Git Service

nvc0: don't make use of push hint if there are no non-const user vbos
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 19 Jun 2016 04:28:36 +0000 (00:28 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 21 Jun 2016 10:29:27 +0000 (11:29 +0100)
This makes the check match up what we do on nv50 as well - there's no
point in switching over the push path if everything's in managed
buffers. This can happen when a shader uses a vertex without an enabled
array - we end up passing it a constant attribute.

This also has the effect of "fixing" some flickering in Talos. I have no
idea why. I've stared at the push logic forwards, backwards, and
sideways. By always forcing the push path (which is slow), the
flickering also goes away, but other rendering is still wrong
(specifically draw 383068 as identified in the bug). However by not
switching over to the push path, draw 383068 is correct.

Note that other flickering remains in Talos, like the red/green
walls/floors. This takes care of the shadow flickering though.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90513
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 154c0a42a23187c61ea0a1307198fae667398eba)

src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c

index 888c094..4e40ff5 100644 (file)
@@ -441,8 +441,10 @@ nvc0_vertex_arrays_validate(struct nvc0_context *nvc0)
    if (unlikely(vertex->need_conversion) ||
        unlikely(nvc0->vertprog->vp.edgeflag < PIPE_MAX_ATTRIBS)) {
       vbo_mode = 3;
+   } else if (nvc0->vbo_user & ~nvc0->constant_vbos) {
+      vbo_mode = nvc0->vbo_push_hint ? 1 : 0;
    } else {
-      vbo_mode = (nvc0->vbo_user && nvc0->vbo_push_hint) ? 1 : 0;
+      vbo_mode = 0;
    }
    const_vbos = vbo_mode ? 0 : nvc0->constant_vbos;