summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-06-06 14:56:10 -0700
committerKenneth Graunke <[email protected]>2019-02-21 10:26:06 -0800
commiteed7f7253eb04e071cb637600dca81e83a7377f1 (patch)
treeb5edf1db7f56c5d04da428c78e3ee5f35d36a3fd /src/gallium/drivers/iris
parent90046b43cced1468e04830db0f1cbc0b54b03731 (diff)
iris: fill out pull constant buffers
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r--src/gallium/drivers/iris/iris_state.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index a993739690b..d47c90f32fb 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -2117,6 +2117,17 @@ use_sampler_view(struct iris_batch *batch, struct iris_sampler_view *isv)
return isv->surface_state_offset;
}
+static uint32_t
+use_const_buffer(struct iris_batch *batch, struct iris_const_buffer *cbuf)
+{
+ struct iris_resource *res = (void *) cbuf->resource;
+ struct iris_resource *state_res = (void *) cbuf->surface_state_resource;
+ iris_use_pinned_bo(batch, res->bo, false);
+ iris_use_pinned_bo(batch, state_res->bo, false);
+
+ return cbuf->surface_state_offset;
+}
+
static void
iris_populate_binding_table(struct iris_context *ice,
struct iris_batch *batch,
@@ -2153,6 +2164,15 @@ iris_populate_binding_table(struct iris_context *ice,
bt_map[s++] = use_sampler_view(batch, view);
}
+ // XXX: want the number of BTE's to shorten this loop
+ struct iris_shader_state *shs = &ice->shaders.state[stage];
+ for (int i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
+ struct iris_const_buffer *cbuf = &shs->constbuf[i];
+ if (!cbuf->surface_state_resource)
+ break;
+
+ bt_map[s++] = use_const_buffer(batch, cbuf);
+ }
#if 0
// XXX: not implemented yet
assert(prog_data->binding_table.pull_constants_start == 0xd0d0d0d0);