radv: reduce the number of parameters export by the GS copy shader
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 14 May 2018 14:04:36 +0000 (16:04 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 14 May 2018 19:38:23 +0000 (21:38 +0200)
By using the geometry shader output usage mask.

This improves all Vulkan demos that use a geometry shader
(ie. geometryshader, deferredshadows, viewportarray).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_nir_to_llvm.c

index 2162ca58e08a6e8b0f1637d471b8f5bec0050d3a..b4af0f294150338b68b198bd3e55f9b580a13ab6 100644 (file)
@@ -2493,10 +2493,9 @@ handle_vs_outputs_post(struct radv_shader_context *ctx,
                        output_usage_mask =
                                ctx->shader_info->info.tes.output_usage_mask[i];
                } else {
-                       /* Enable all channels for the GS copy shader because
-                        * we don't know the output usage mask currently.
-                        */
-                       output_usage_mask = 0xf;
+                       assert(ctx->is_gs_copy_shader);
+                       output_usage_mask =
+                               ctx->shader_info->info.gs.output_usage_mask[i];
                }
 
                radv_export_param(ctx, param_count, values, output_usage_mask);