aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50/nv50_context.c
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2014-11-15 15:43:22 -0500
committerIlia Mirkin <[email protected]>2014-11-23 15:43:28 -0500
commitfecae4625cf9a132bb3fbfeaadbbf3db68be6024 (patch)
treeb2c2a8dd7b2f19d34ed8138e2f12d52c95d7e514 /src/gallium/drivers/nouveau/nv50/nv50_context.c
parente80a0a7d9a02fe12dedfb2e221358af620759c28 (diff)
nv50,nvc0: buffer resources can be bound as other things down the line
res->bind is not an indicator of how the resource is currently bound. buffers can be rebound across different binding points without changing underlying storage. Signed-off-by: Ilia Mirkin <[email protected]> Cc: "10.4 10.3" <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_context.c')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_context.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c
index 5e907d73b9a..1a53579b49d 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_context.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c
@@ -180,7 +180,12 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
}
}
- if (res->bind & PIPE_BIND_VERTEX_BUFFER) {
+ if (res->bind & (PIPE_BIND_VERTEX_BUFFER |
+ PIPE_BIND_INDEX_BUFFER |
+ PIPE_BIND_CONSTANT_BUFFER |
+ PIPE_BIND_STREAM_OUTPUT |
+ PIPE_BIND_SAMPLER_VIEW)) {
+
assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
for (i = 0; i < nv50->num_vtxbufs; ++i) {
if (nv50->vtxbuf[i].buffer == res) {
@@ -190,14 +195,11 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
return ref;
}
}
- }
- if (res->bind & PIPE_BIND_INDEX_BUFFER) {
+
if (nv50->idxbuf.buffer == res)
if (!--ref)
return ref;
- }
- if (res->bind & PIPE_BIND_SAMPLER_VIEW) {
for (s = 0; s < 3; ++s) {
assert(nv50->num_textures[s] <= PIPE_MAX_SAMPLERS);
for (i = 0; i < nv50->num_textures[s]; ++i) {
@@ -210,9 +212,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
}
}
}
- }
- if (res->bind & PIPE_BIND_CONSTANT_BUFFER) {
for (s = 0; s < 3; ++s) {
for (i = 0; i < NV50_MAX_PIPE_CONSTBUFS; ++i) {
if (!(nv50->constbuf_valid[s] & (1 << i)))