ac/nir_to_llvm: fix component packing for double outputs

We need to wait until after the writemask is widened before we
adjust it for component packing.

Together with the previous patch this fixes a number of
arb_enhanced_layouts component layout piglit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Timothy Arceri
2018-03-21 12:23:08 +11:00
parent fc51fdbcde
commit 51f175028d
+3 -1
View File
@@ -1793,7 +1793,7 @@ visit_store_var(struct ac_nir_context *ctx,
int idx = instr->variables[0]->var->data.driver_location;
unsigned comp = instr->variables[0]->var->data.location_frac;
LLVMValueRef src = ac_to_float(&ctx->ac, get_src(ctx, instr->src[0]));
int writemask = instr->const_index[0] << comp;
int writemask = instr->const_index[0];
LLVMValueRef indir_index;
unsigned const_index;
get_deref_offset(ctx, instr->variables[0], false,
@@ -1808,6 +1808,8 @@ visit_store_var(struct ac_nir_context *ctx,
writemask = widen_mask(writemask, 2);
}
writemask = writemask << comp;
switch (instr->variables[0]->var->data.mode) {
case nir_var_shader_out: