[Mesa-dev] [PATCH 25/27] radeonsi: set user clip planes for the tessellation evaluation shader
Marek Olšák
maraeo at gmail.com
Tue Jun 16 16:06:28 PDT 2015
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeonsi/si_state.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 4d6ff38..05cb67f 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -465,10 +465,18 @@ static void si_set_clip_state(struct pipe_context *ctx,
}
cb.buffer = NULL;
- cb.user_buffer = state->ucp;
- cb.buffer_offset = 0;
- cb.buffer_size = 4*4*8;
+ cb.user_buffer = NULL;
+ cb.buffer_size = sizeof(state->ucp);
+
+ si_upload_const_buffer(sctx, (struct r600_resource**)&cb.buffer,
+ (void*)state->ucp, sizeof(state->ucp),
+ &cb.buffer_offset);
+
+ /* TODO: can we have a buffer slot that is shared by all stages,
+ * so that we don't have to bind this twice?
+ */
ctx->set_constant_buffer(ctx, PIPE_SHADER_VERTEX, SI_DRIVER_STATE_CONST_BUF, &cb);
+ ctx->set_constant_buffer(ctx, PIPE_SHADER_TESS_EVAL, SI_DRIVER_STATE_CONST_BUF, &cb);
pipe_resource_reference(&cb.buffer, NULL);
si_pm4_set_state(sctx, clip, pm4);
--
2.1.0
More information about the mesa-dev
mailing list