radv: fix gathering clip/cull distance masks for GS
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 16 Jul 2019 06:37:32 +0000 (08:37 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 16 Jul 2019 08:09:37 +0000 (10:09 +0200)
For NGG, the driver relies on the VS outinfo struct.

This fixes
dEQP-VK.clipping.user_defined.clip_*_vert_tess_geom_*

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_nir_to_llvm.c

index 7573292f5c8ef1e15fcac275d78f4fe0bf6020e0..aa50b91d8c05453862b2b2b4067825274b89c27a 100644 (file)
@@ -2407,6 +2407,11 @@ scan_shader_output_decl(struct radv_shader_context *ctx,
                                ctx->shader_info->tes.outinfo.cull_dist_mask = (1 << shader->info.cull_distance_array_size) - 1;
                                ctx->shader_info->tes.outinfo.cull_dist_mask <<= shader->info.clip_distance_array_size;
                        }
+                       if (stage == MESA_SHADER_GEOMETRY) {
+                               ctx->shader_info->vs.outinfo.clip_dist_mask = (1 << shader->info.clip_distance_array_size) - 1;
+                               ctx->shader_info->vs.outinfo.cull_dist_mask = (1 << shader->info.cull_distance_array_size) - 1;
+                               ctx->shader_info->vs.outinfo.cull_dist_mask <<= shader->info.clip_distance_array_size;
+                       }
                }
        }