nv50: access only the available amount of constbuf
[mesa.git] / src / gallium / drivers / nouveau / nv50 / nv50_context.c
index eb345dc24bc3417ae23290699741eb5298c199ba..bd00b5014468db77eb339aca5937894b1305b752 100644 (file)
@@ -179,7 +179,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
    }
 
    if (res->bind & PIPE_BIND_CONSTANT_BUFFER) {
-      for (s = 0; s < 5; ++s) {
+      for (s = 0; s < 3; ++s) {
       for (i = 0; i < nv50->num_vtxbufs; ++i) {
          if (!nv50->constbuf[s][i].user &&
              nv50->constbuf[s][i].u.buf == res) {