radv: gather the output usage mask for clip/cull distances correctly
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 30 Aug 2018 07:43:29 +0000 (09:43 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 31 Aug 2018 15:34:41 +0000 (17:34 +0200)
It's a special case because both are combined into a single array.

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

index 5925fd924c8bdd624e8b23a7a03e17bb63c74d73..6262acb1a655f60bfb1a1fd2c9c0c7fc961f18d6 100644 (file)
@@ -128,6 +128,14 @@ set_output_usage_mask(const nir_shader *nir, const nir_intrinsic_instr *instr,
 
        get_deref_offset(deref_instr, &const_offset);
 
+       if (idx == VARYING_SLOT_CLIP_DIST0) {
+               /* Special case for clip/cull distances because there are
+                * combined into a single array that contains both.
+                */
+               output_usage_mask[idx] |= 1 << const_offset;
+               return;
+       }
+
        for (unsigned i = 0; i < attrib_count; i++) {
                output_usage_mask[idx + i + const_offset] |=
                        instr->const_index[0] << comp;