Commit 5703ecf6 authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen
Browse files

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's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
parent 8d171859
...@@ -1881,7 +1881,8 @@ static LLVMValueRef load_tess_varyings(struct ac_nir_context *ctx, ...@@ -1881,7 +1881,8 @@ static LLVMValueRef load_tess_varyings(struct ac_nir_context *ctx,
static LLVMValueRef visit_load_var(struct ac_nir_context *ctx, static LLVMValueRef visit_load_var(struct ac_nir_context *ctx,
nir_intrinsic_instr *instr) 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]; LLVMValueRef values[8];
int idx = 0; int idx = 0;
...@@ -1902,11 +1903,14 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx, ...@@ -1902,11 +1903,14 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx,
comp = var->data.location_frac; comp = var->data.location_frac;
mode = var->data.mode; 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); &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; ve *= 2;
switch (mode) { switch (mode) {
...@@ -1920,8 +1924,8 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx, ...@@ -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); LLVMTypeRef type = LLVMIntTypeInContext(ctx->ac.context, instr->dest.ssa.bit_size);
LLVMValueRef indir_index; LLVMValueRef indir_index;
unsigned const_index, vertex_index; unsigned const_index, vertex_index;
get_deref_offset(ctx, nir_instr_as_deref(instr->src[0].ssa->parent_instr), get_deref_offset(ctx, deref, false, &vertex_index, NULL,
false, &vertex_index, NULL, &const_index, &indir_index); &const_index, &indir_index);
return ctx->abi->load_inputs(ctx->abi, var->data.location, return ctx->abi->load_inputs(ctx->abi, var->data.location,
var->data.driver_location, var->data.driver_location,
...@@ -2024,7 +2028,9 @@ visit_store_var(struct ac_nir_context *ctx, ...@@ -2024,7 +2028,9 @@ visit_store_var(struct ac_nir_context *ctx,
comp = var->data.location_frac; 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, src = LLVMBuildBitCast(ctx->ac.builder, src,
LLVMVectorType(ctx->ac.f32, ac_get_llvm_num_components(src) * 2), LLVMVectorType(ctx->ac.f32, ac_get_llvm_num_components(src) * 2),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment