summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-08-17 13:48:44 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-11-23 21:23:38 -0800
commitec1f159ac81ed964415d102eed4a0a29be8e7937 (patch)
treee569c680464b23b694808e0fa56cc6cc2e909a23
parent8cdf73c324bccebd043f725cf218cc530d2588c3 (diff)
i965: Always reserve clip distance VUE slots in SSO mode.
This fixes rendering in Dolphin on Vulkan since we enabled clip distances. (Dolphin on GL has a similar bug because the linker fails to eliminate unused clip distance built-in arrays, but it isn't using SSO...so that needs more fixing.) Also fixes a Piglit test: spec/glsl-1.50/execution/geometry.clip-distance-vs-gs-out-sso Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vue_map.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vue_map.c b/src/mesa/drivers/dri/i965/brw_vue_map.c
index f1af22147c..4d509d3901 100644
--- a/src/mesa/drivers/dri/i965/brw_vue_map.c
+++ b/src/mesa/drivers/dri/i965/brw_vue_map.c
@@ -68,6 +68,19 @@ brw_compute_vue_map(const struct gen_device_info *devinfo,
if (devinfo->gen < 6)
separate = false;
+ if (separate) {
+ /* In SSO mode, we don't know whether the adjacent stage will
+ * read/write gl_ClipDistance, which has a fixed slot location.
+ * We have to assume the worst and reserve a slot for it, or else
+ * the rest of our varyings will be off by a slot.
+ *
+ * Note that we don't have to worry about COL/BFC, as those built-in
+ * variables only exist in legacy GL, which only supports VS and FS.
+ */
+ slots_valid |= BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST0);
+ slots_valid |= BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST1);
+ }
+
vue_map->slots_valid = slots_valid;
vue_map->separate = separate;