diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-01-24 01:28:16 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2019-02-06 22:36:06 +0100 |
commit | 5703ecf6511f614eec2ae063924ddb205de99c72 (patch) | |
tree | ebcb866a5f2ad9a104dd2de95a3a36162150e831 /src/amd | |
parent | 8d1718590b643aea744748ae4eeb83e0c82aab0c (diff) |
amd/common: Do not use 32-bit loads for shared memory.
We use a straight glsl->llvm type conversion so types should already be right.
Also even though the writemasks were changed we we not actually doing 32-bit
things, so this fails miserably.
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index b24f2d59fde..f78b6b505c0 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -1881,7 +1881,8 @@ static LLVMValueRef load_tess_varyings(struct ac_nir_context *ctx, static LLVMValueRef visit_load_var(struct ac_nir_context *ctx, nir_intrinsic_instr *instr) { - nir_variable *var = nir_deref_instr_get_variable(nir_instr_as_deref(instr->src[0].ssa->parent_instr)); + nir_deref_instr *deref = nir_instr_as_deref(instr->src[0].ssa->parent_instr); + nir_variable *var = nir_deref_instr_get_variable(deref); LLVMValueRef values[8]; int idx = 0; @@ -1902,11 +1903,14 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx, comp = var->data.location_frac; mode = var->data.mode; - get_deref_offset(ctx, nir_instr_as_deref(instr->src[0].ssa->parent_instr), vs_in, NULL, NULL, + get_deref_offset(ctx, deref, vs_in, NULL, NULL, &const_index, &indir_index); } - if (instr->dest.ssa.bit_size == 64) + if (instr->dest.ssa.bit_size == 64 && + (deref->mode == nir_var_shader_in || + deref->mode == nir_var_shader_out || + deref->mode == nir_var_function_temp)) ve *= 2; switch (mode) { @@ -1920,8 +1924,8 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx, LLVMTypeRef type = LLVMIntTypeInContext(ctx->ac.context, instr->dest.ssa.bit_size); LLVMValueRef indir_index; unsigned const_index, vertex_index; - get_deref_offset(ctx, nir_instr_as_deref(instr->src[0].ssa->parent_instr), - false, &vertex_index, NULL, &const_index, &indir_index); + get_deref_offset(ctx, deref, false, &vertex_index, NULL, + &const_index, &indir_index); return ctx->abi->load_inputs(ctx->abi, var->data.location, var->data.driver_location, @@ -2024,7 +2028,9 @@ visit_store_var(struct ac_nir_context *ctx, comp = var->data.location_frac; } - if (ac_get_elem_bits(&ctx->ac, LLVMTypeOf(src)) == 64) { + if (ac_get_elem_bits(&ctx->ac, LLVMTypeOf(src)) == 64 && + (deref->mode == nir_var_shader_out || + deref->mode == nir_var_function_temp)) { src = LLVMBuildBitCast(ctx->ac.builder, src, LLVMVectorType(ctx->ac.f32, ac_get_llvm_num_components(src) * 2), |