ac/nir: Sanitize location_frac for local variables.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 10 Jan 2018 16:05:10 +0000 (17:05 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 10 Jan 2018 23:56:52 +0000 (00:56 +0100)
If they were promoted from inputs/outputs, they could have a
non-zero value left over, which messed with our store handling.

Fixes: 06f05040eb "radv: Link shaders."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/amd/common/ac_nir_to_llvm.c

index 5885c70..8301b16 100644 (file)
@@ -5556,6 +5556,7 @@ setup_locals(struct ac_nir_context *ctx,
        nir_foreach_variable(variable, &func->impl->locals) {
                unsigned attrib_count = glsl_count_attribute_slots(variable->type, false);
                variable->data.driver_location = ctx->num_locals * 4;
+               variable->data.location_frac = 0;
                ctx->num_locals += attrib_count;
        }
        ctx->locals = malloc(4 * ctx->num_locals * sizeof(LLVMValueRef));