Mesa (nv50-compiler): nv50: fix constbuf validation

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Wed Aug 4 15:49:20 PDT 2010


Module: Mesa
Branch: nv50-compiler
Commit: 720e0c430d0a66cbf5adfcf40030f27e55ad6c6a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=720e0c430d0a66cbf5adfcf40030f27e55ad6c6a

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sat Jul 31 21:30:35 2010 +0200

nv50: fix constbuf validation

We only uploaded up to the highest offset a program would use,
and if the constant buffer isn't changed when a new program is
used, the new program is missing the rest of them.

Might want to introduce a "fill state" for user mem constbufs.

---

 src/gallium/drivers/nv50/nv50_shader_state.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_shader_state.c b/src/gallium/drivers/nv50/nv50_shader_state.c
index f7e6355..3d5df59 100644
--- a/src/gallium/drivers/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nv50/nv50_shader_state.c
@@ -44,7 +44,7 @@ nv50_transfer_constbuf(struct nv50_context *nv50,
    if (!map)
       return;
 
-   count = MIN2(buf->width0, size);
+   count = buf->width0; /* MIN2(buf->width0, size); */
    start = 0;
 
    while (count) {
@@ -92,8 +92,13 @@ nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p)
       }
    }
 
+   /* If the state tracker doesn't change the constbuf, and it is first
+    * validated with a program that doesn't use it, this check prevents
+    * it from even being uploaded. */
+   /*
    if (p->parm_size == 0)
       return;
+   */
 
    switch (p->type) {
    case PIPE_SHADER_VERTEX:



More information about the mesa-commit mailing list