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];
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;
}
/**
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;
}