summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/evergreen_state.c
diff options
context:
space:
mode:
authorVadim Girlin <[email protected]>2012-01-21 01:37:48 +0400
committerDave Airlie <[email protected]>2012-01-21 12:43:14 +0000
commit54e8dcaad65cbe3603730414fd8d76ac53f89a86 (patch)
tree76af72a0c0697df506fd19e450174302cbc2a3fc /src/gallium/drivers/r600/evergreen_state.c
parentd649bf51ec787021f7872e2a4c09fb2188c0891b (diff)
r600g: implement clip vertex v2
Clip planes are uploaded as a constant buffer and used by the vertex shader to produce corresponding clip distances for hw clipping. Signed-off-by: Vadim Girlin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r--src/gallium/drivers/r600/evergreen_state.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 2f7046bcba6..96c11442388 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1211,6 +1211,7 @@ static void evergreen_set_clip_state(struct pipe_context *ctx,
{
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
+ struct pipe_resource *cbuf;
if (rstate == NULL)
return;
@@ -1235,6 +1236,13 @@ static void evergreen_set_clip_state(struct pipe_context *ctx,
free(rctx->states[R600_PIPE_STATE_CLIP]);
rctx->states[R600_PIPE_STATE_CLIP] = rstate;
r600_context_pipe_state_set(&rctx->ctx, rstate);
+
+ cbuf = pipe_user_buffer_create(ctx->screen,
+ state->ucp,
+ 4*4*8, /* 8*4 floats */
+ PIPE_BIND_CONSTANT_BUFFER);
+ r600_set_constant_buffer(ctx, PIPE_SHADER_VERTEX, 1, cbuf);
+ pipe_resource_reference(&cbuf, NULL);
}
static void evergreen_set_polygon_stipple(struct pipe_context *ctx,