aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i965/brw_pipe_rast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/i965/brw_pipe_rast.c')
-rw-r--r--src/gallium/drivers/i965/brw_pipe_rast.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/gallium/drivers/i965/brw_pipe_rast.c b/src/gallium/drivers/i965/brw_pipe_rast.c
new file mode 100644
index 00000000000..ff64dbd48d4
--- /dev/null
+++ b/src/gallium/drivers/i965/brw_pipe_rast.c
@@ -0,0 +1,46 @@
+
+static void
+calculate_clip_key_rast()
+{
+ if (BRW_IS_IGDNG(brw))
+ key.clip_mode = BRW_CLIPMODE_KERNEL_CLIP;
+ else
+ key.clip_mode = BRW_CLIPMODE_NORMAL;
+
+ key.do_flat_shading = brw->rast->templ.flatshade;
+
+ if (key.primitive == PIPE_PRIM_TRIANGLES) {
+ if (brw->rast->templ.cull_mode = PIPE_WINDING_BOTH)
+ key.clip_mode = BRW_CLIPMODE_REJECT_ALL;
+ else {
+ key.fill_ccw = CLIP_CULL;
+ key.fill_cw = CLIP_CULL;
+
+ if (!(brw->rast->templ.cull_mode & PIPE_WINDING_CCW)) {
+ key.fill_ccw = translate_fill(brw->rast.fill_ccw);
+ }
+
+ if (!(brw->rast->templ.cull_mode & PIPE_WINDING_CW)) {
+ key.fill_cw = translate_fill(brw->rast.fill_cw);
+ }
+
+ if (key.fill_cw != CLIP_FILL ||
+ key.fill_ccw != CLIP_FILL) {
+ key.do_unfilled = 1;
+ key.clip_mode = BRW_CLIPMODE_CLIP_NON_REJECTED;
+ }
+
+ key.offset_ccw = brw->rast.templ.offset_ccw;
+ key.offset_cw = brw->rast.templ.offset_cw;
+
+ if (brw->rast.templ.light_twoside &&
+ key.fill_cw != CLIP_CULL)
+ key.copy_bfc_cw = 1;
+
+ if (brw->rast.templ.light_twoside &&
+ key.fill_ccw != CLIP_CULL)
+ key.copy_bfc_ccw = 1;
+ }
+ }
+ }
+}