diff options
author | Dave Airlie <[email protected]> | 2017-02-01 11:10:49 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-02-02 08:25:04 +1000 |
commit | fa316ed02ff0c2c4c8121380d23f2e66ac87649f (patch) | |
tree | c48de63bd38f6d5044f3c79f00002c936a97e1bf | |
parent | 230e308ff9a1d6ac6519db70d4e3038c2c948088 (diff) |
radv/ac: handle clip/cull distance sizing in geometry shader outputs
Otherwise we were writing these as 4 components, and things went bad.
Fixes (the remaining):
dEQP-VK.clipping.user_defined.*.vert_geom.*
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 8075eda4100..7c368545a14 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -4318,17 +4318,19 @@ handle_shader_output_decl(struct nir_to_llvm_context *ctx, variable->data.driver_location = idx * 4; - if (ctx->stage == MESA_SHADER_VERTEX) { - + if (ctx->stage == MESA_SHADER_VERTEX || + ctx->stage == MESA_SHADER_GEOMETRY) { if (idx == VARYING_SLOT_CLIP_DIST0 || idx == VARYING_SLOT_CULL_DIST0) { int length = glsl_get_length(variable->type); - if (idx == VARYING_SLOT_CLIP_DIST0) { - ctx->shader_info->vs.clip_dist_mask = (1 << length) - 1; - ctx->num_clips = length; - } else if (idx == VARYING_SLOT_CULL_DIST0) { - ctx->shader_info->vs.cull_dist_mask = (1 << length) - 1; - ctx->num_culls = length; + if (ctx->stage == MESA_SHADER_VERTEX) { + if (idx == VARYING_SLOT_CLIP_DIST0) { + ctx->shader_info->vs.clip_dist_mask = (1 << length) - 1; + ctx->num_clips = length; + } else if (idx == VARYING_SLOT_CULL_DIST0) { + ctx->shader_info->vs.cull_dist_mask = (1 << length) - 1; + ctx->num_culls = length; + } } if (length > 4) attrib_count = 2; |