Constant buffers must be bound for compute like for 3D. This is done
by adding a new 'shader' parameter to nvc0_cb_bo_push() which allows
to use the compute channel for compute shaders, and the 3D channel
for other shader types.
Signed-off-by: Samuel Pitoiset <[email protected]>
---
src/gallium/drivers/nouveau/nvc0/nvc0_context.h | 2 +-
src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 2 +-
src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c | 15 +++++++++++----
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
index 2e726e6..2ab70e8 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
@@ -301,7 +301,7 @@ nve4_p2mf_push_linear(struct nouveau_context *nv,
unsigned size, const void *data);
void
nvc0_cb_bo_push(struct nouveau_context *,
- struct nouveau_bo *bo, unsigned domain,
+ struct nouveau_bo *bo, unsigned domain, unsigned shader,
unsigned base, unsigned size,
unsigned offset, unsigned words, const uint32_t *data);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
index 2bb9b44..97fcfbc 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
@@ -441,7 +441,7 @@ nvc0_constbufs_validate(struct nvc0_context *nvc0)
PUSH_DATA (push, (0 << 4) | 1);
}
nvc0_cb_bo_push(&nvc0->base, bo,
NV_VRAM_DOMAIN(&nvc0->screen->base),
- base, nvc0->state.uniform_buffer_bound[s],
+ base, nvc0->state.uniform_buffer_bound[s], s,
0, (size + 3) / 4,
nvc0->constbuf[s][0].u.data);
} else {
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c
b/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c
index 279c7e9..5cea822 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c
@@ -4,6 +4,7 @@
#include "nvc0/nvc0_context.h"
#include "nv50/nv50_defs.xml.h"
+#include "nvc0/nvc0_compute.xml.h"
struct nvc0_transfer {
struct pipe_transfer base;
@@ -532,7 +533,7 @@ nvc0_cb_push(struct nouveau_context *nv,
if (cb) {
nvc0_cb_bo_push(nv, res->bo, res->domain,
- res->offset + cb->offset, cb->size,
+ res->offset + cb->offset, cb->size, s,