summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-06-06 14:14:31 -0700
committerKenneth Graunke <[email protected]>2019-02-21 10:26:06 -0800
commit4e007dbb3097e965b736f35ccfdd00ebf025423b (patch)
treef680015fb91b1adeffaeec613f97cd887dedc0ab /src/gallium/drivers/iris/iris_state.c
parent9ea05ccf1f20691cde6911762bce8207c7283714 (diff)
iris: have more than one const_offset
Diffstat (limited to 'src/gallium/drivers/iris/iris_state.c')
-rw-r--r--src/gallium/drivers/iris/iris_state.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index e0000c19887..3e81cd95842 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -1345,17 +1345,17 @@ iris_set_constant_buffer(struct pipe_context *ctx,
struct iris_context *ice = (struct iris_context *) ctx;
gl_shader_stage stage = stage_from_pipe(p_stage);
struct iris_shader_state *shs = &ice->shaders.state[stage];
+ struct iris_const_buffer *cbuf = &shs->constbuf[index];
if (input && (input->buffer || input->user_buffer)) {
if (input->user_buffer) {
u_upload_data(ctx->const_uploader, 0, input->buffer_size, 32,
- input->user_buffer, &shs->const_offset,
- &shs->const_resources[index]);
+ input->user_buffer, &cbuf->offset, &cbuf->res);
} else {
- pipe_resource_reference(&shs->const_resources[index], input->buffer);
+ pipe_resource_reference(&cbuf->res, input->buffer);
}
} else {
- pipe_resource_reference(&shs->const_resources[index], NULL);
+ pipe_resource_reference(&cbuf->res, NULL);
}
}
@@ -2260,14 +2260,14 @@ iris_upload_render_state(struct iris_context *ice,
continue;
// XXX: is range->block a constbuf index? it would be nice
- struct iris_resource *res =
- (void *) shs->const_resources[range->block];
+ struct iris_const_buffer *cbuf = &shs->constbuf[range->block];
+ struct iris_resource *res = (void *) cbuf->res;
- assert(shs->const_offset % 32 == 0);
+ assert(cbuf->offset % 32 == 0);
pkt.ConstantBody.ReadLength[n] = range->length;
pkt.ConstantBody.Buffer[n] =
- ro_bo(res->bo, range->start * 32 + shs->const_offset);
+ ro_bo(res->bo, range->start * 32 + cbuf->offset);
n--;
}
}