aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-11-09 02:11:16 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:09 -0800
commita98634a28fc1f0cb9ff5d0e152d6e8b61b6b1070 (patch)
tree203d177f77391fb8d4395e14a5645b7d44eadd25 /src/gallium
parentc60ce3f4fd8ff4d5e66122c82fd789713d7c1982 (diff)
iris: actually upload clip planes.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/iris/iris_context.h1
-rw-r--r--src/gallium/drivers/iris/iris_state.c16
2 files changed, 15 insertions, 2 deletions
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 520ce055ea2..44040bf923d 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -437,6 +437,7 @@ struct iris_context {
struct pipe_scissor_state scissors[IRIS_MAX_VIEWPORTS];
struct pipe_stencil_ref stencil_ref;
struct pipe_framebuffer_state framebuffer;
+ struct pipe_clip_state clip_planes;
float default_outer_level[4];
float default_inner_level[2];
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 353043c0595..f0f426cebab 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -1748,11 +1748,17 @@ iris_surface_destroy(struct pipe_context *ctx, struct pipe_surface *p_surf)
free(surf);
}
-// XXX: actually implement user clip planes
static void
iris_set_clip_state(struct pipe_context *ctx,
const struct pipe_clip_state *state)
{
+ struct iris_context *ice = (struct iris_context *) ctx;
+ struct iris_shader_state *shs = &ice->state.shaders[MESA_SHADER_VERTEX];
+
+ memcpy(&ice->state.clip_planes, state, sizeof(*state));
+
+ ice->state.dirty |= IRIS_DIRTY_CONSTANTS_VS;
+ shs->cbuf0_needs_upload = true;
}
/**
@@ -2184,7 +2190,13 @@ upload_uniforms(struct iris_context *ice,
uint32_t sysval = shader->system_values[i];
uint32_t value = 0;
- printf("got a param to upload - %u\n", sysval);
+ if (BRW_PARAM_BUILTIN_IS_CLIP_PLANE(sysval)) {
+ int plane = BRW_PARAM_BUILTIN_CLIP_PLANE_IDX(sysval);
+ int comp = BRW_PARAM_BUILTIN_CLIP_PLANE_COMP(sysval);
+ value = fui(ice->state.clip_planes.ucp[plane][comp]);
+ } else {
+ assert(!"unhandled system value");
+ }
*map++ = value;
}