summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-01-11 22:11:19 +0100
committerSamuel Pitoiset <[email protected]>2016-02-21 10:41:32 +0100
commita9b70a86db9fe948ca7ce40aad4831408b1377ef (patch)
tree833463db331e743c29ecf92f404f586424f42c97 /src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
parent527652629dc6e7dc593e16505e4b6b648b1f09cc (diff)
nvc0: bind driver constbuf for compute on Fermi
Changes from v3: - add new validation state for COMPUTE driver constbuf Changes from v2: - always bind the driver consts even if user params come in via clover Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_compute.c')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_compute.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
index 0fe6353b2ab..2314c5386ca 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
@@ -196,6 +196,22 @@ nvc0_compute_validate_constbufs(struct nvc0_context *nvc0)
PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CB);
}
+static void
+nvc0_compute_validate_driverconst(struct nvc0_context *nvc0)
+{
+ struct nouveau_pushbuf *push = nvc0->base.pushbuf;
+ struct nvc0_screen *screen = nvc0->screen;
+
+ BEGIN_NVC0(push, NVC0_COMPUTE(CB_SIZE), 3);
+ PUSH_DATA (push, 1024);
+ PUSH_DATAh(push, screen->uniform_bo->offset + (6 << 16) + (5 << 10));
+ PUSH_DATA (push, screen->uniform_bo->offset + (6 << 16) + (5 << 10));
+ BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1);
+ PUSH_DATA (push, (15 << 8) | 1);
+
+ nvc0->dirty |= NVC0_NEW_DRIVERCONST;
+}
+
static bool
nvc0_compute_state_validate(struct nvc0_context *nvc0)
{
@@ -203,6 +219,8 @@ nvc0_compute_state_validate(struct nvc0_context *nvc0)
return false;
if (nvc0->dirty_cp & NVC0_NEW_CP_CONSTBUF)
nvc0_compute_validate_constbufs(nvc0);
+ if (nvc0->dirty_cp & NVC0_NEW_CP_DRIVERCONST)
+ nvc0_compute_validate_driverconst(nvc0);
/* TODO: textures, samplers, surfaces, global memory buffers */