aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-04-08 00:56:54 +0200
committerSamuel Pitoiset <[email protected]>2016-04-26 19:47:49 +0200
commit1eca4c51a2c3fcaf4e39e5bad8eefcea547530fa (patch)
treeaa5e407fbcee9fad7765ac2236148b1291ee62c9 /src/gallium/drivers/nouveau/nvc0/nve4_compute.c
parentc6b3c346d15b834d17c97aa4a45714c18f219351 (diff)
nvc0: bind images on compute shaders for Kepler
Old surfaces validation code will be removed once images are completely done for Fermi/Kepler, that explains why I only disable it for now. This also introduces nvc0_get_surface_dims() which computes correct dimensions regarding the given target. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nve4_compute.c')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nve4_compute.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
index 441166ac418..05a49b1c9ad 100644
--- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
+++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
@@ -192,7 +192,44 @@ nve4_screen_compute_setup(struct nvc0_screen *screen,
return 0;
}
+static void
+nve4_compute_validate_surfaces(struct nvc0_context *nvc0)
+{
+ struct nouveau_pushbuf *push = nvc0->base.pushbuf;
+ uint64_t address;
+ const int s = 5;
+ int i, j;
+
+ if (!nvc0->images_dirty[s])
+ return;
+
+ address = nvc0->screen->uniform_bo->offset + NVC0_CB_AUX_INFO(s);
+
+ BEGIN_NVC0(push, NVE4_CP(UPLOAD_DST_ADDRESS_HIGH), 2);
+ PUSH_DATAh(push, address + NVC0_CB_AUX_SU_INFO(0));
+ PUSH_DATA (push, address + NVC0_CB_AUX_SU_INFO(0));
+ BEGIN_NVC0(push, NVE4_CP(UPLOAD_LINE_LENGTH_IN), 2);
+ PUSH_DATA (push, 16 * NVC0_MAX_IMAGES * 4);
+ PUSH_DATA (push, 0x1);
+ BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + 16 * NVC0_MAX_IMAGES);
+ PUSH_DATA (push, NVE4_COMPUTE_UPLOAD_EXEC_LINEAR | (0x20 << 1));
+
+ for (i = 0; i < NVC0_MAX_IMAGES; ++i) {
+ struct pipe_image_view *view = &nvc0->images[s][i];
+ if (view->resource) {
+ struct nv04_resource *res = nv04_resource(view->resource);
+
+ nve4_set_surface_info(push, view, screen);
+ BCTX_REFN(nvc0->bufctx_cp, CP_SUF, res, RDWR);
+ } else {
+ for (j = 0; j < 16; j++)
+ PUSH_DATA(push, 0);
+ }
+ }
+}
+/* Will be removed once images are completely done. */
+#if 0
static void
nve4_compute_validate_surfaces(struct nvc0_context *nvc0)
{
@@ -259,7 +296,7 @@ nve4_compute_validate_surfaces(struct nvc0_context *nvc0)
nvc0->surfaces_dirty[t] = 0;
}
-
+#endif
/* Thankfully, textures with samplers follow the normal rules. */
static void