radv: fix regression with mask attrib setting code.
authorDave Airlie <airlied@redhat.com>
Thu, 30 Mar 2017 02:06:52 +0000 (12:06 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 30 Mar 2017 02:07:32 +0000 (12:07 +1000)
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 8f09b0d0d56d897d6b4a2fab1828af0e3cec25c9..5e69a75b4cb57bdb5e55823eddd57a3b22d613d7 100644 (file)
@@ -4181,6 +4181,7 @@ handle_shader_output_decl(struct nir_to_llvm_context *ctx,
        unsigned mask_attribs;
        variable->data.driver_location = idx * 4;
 
+       mask_attribs = ((1ull << attrib_count) - 1) << idx;
        if (ctx->stage == MESA_SHADER_VERTEX ||
            ctx->stage == MESA_SHADER_GEOMETRY) {
                if (idx == VARYING_SLOT_CLIP_DIST0) {
@@ -4194,10 +4195,9 @@ handle_shader_output_decl(struct nir_to_llvm_context *ctx,
                                attrib_count = 2;
                        else
                                attrib_count = 1;
+                       mask_attribs = 1 << idx;
                }
-               mask_attribs = 1 << idx;
-       } else
-               mask_attribs = ((1ull << attrib_count) - 1) << idx;
+       }
 
        for (unsigned i = 0; i < attrib_count; ++i) {
                for (unsigned chan = 0; chan < 4; chan++) {