Improve attr_skip computation in gen7_fill_3DSTATE_SBE_body() to
handle gl_ClipDistance coming out of VS and possibly read by FS.
Also create temporary macro CLIP_ENABLE to make it slightly easier
to enable/disable user clipping. This will shortly be replaced with
code that correctly sets based on ClipDistance writes (or not) in VS.
diff --git a/icd/intel/cmd_pipeline.c b/icd/intel/cmd_pipeline.c
index 0885008..da843ae 100644
--- a/icd/intel/cmd_pipeline.c
+++ b/icd/intel/cmd_pipeline.c
@@ -454,15 +454,12 @@
CMD_ASSERT(cmd, 6, 7.5);
/* VS outputs VUE header and position additionally */
- assert(vs->out_count >= 2);
- attr_skip = 2;
+ assert(vs->out_count >= fs->in_count + 2);
+ attr_skip = vs->out_count - fs->in_count;
attr_count = vs->out_count - attr_skip;
- // LunarG TODO: Redo this assert for user varyings only
- // and then only assert that vs_out is greater than fs_in?
- //assert(fs->in_count == attr_count);
assert(fs->in_count <= 32);
- vue_offset = attr_skip / 2;
+ vue_offset = (attr_skip + 1) / 2;
vue_len = (attr_count + 1) / 2;
if (!vue_len)
vue_len = 1;
@@ -564,12 +561,15 @@
raster->cmd_clip_cull;
}
+// LunarG GSF CLIP TODO
+#define CLIP_ENABLE 1
+
dw2 = GEN6_CLIP_DW2_CLIP_ENABLE |
GEN6_CLIP_DW2_XY_TEST_ENABLE |
GEN6_CLIP_DW2_APIMODE_OGL |
// LunarG GSF CLIP TODO
//state->clip_plane_enable << GEN6_CLIP_DW2_UCP_CLIP_ENABLES__SHIFT |
- 1 << GEN6_CLIP_DW2_UCP_CLIP_ENABLES__SHIFT |
+ CLIP_ENABLE << GEN6_CLIP_DW2_UCP_CLIP_ENABLES__SHIFT |
pipeline->provoking_vertex_tri << GEN6_CLIP_DW2_TRI_PROVOKE__SHIFT |
pipeline->provoking_vertex_line << GEN6_CLIP_DW2_LINE_PROVOKE__SHIFT |
pipeline->provoking_vertex_trifan << GEN6_CLIP_DW2_TRIFAN_PROVOKE__SHIFT;