Commit d4ecc3c9 authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen Committed by Dave Airlie

ac/nir: Add loading from LDS for merged GS.

Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
parent ec53e527
...@@ -3008,21 +3008,27 @@ load_gs_input(struct nir_to_llvm_context *ctx, ...@@ -3008,21 +3008,27 @@ load_gs_input(struct nir_to_llvm_context *ctx,
param = shader_io_get_unique_index(instr->variables[0]->var->data.location); param = shader_io_get_unique_index(instr->variables[0]->var->data.location);
for (unsigned i = 0; i < instr->num_components; i++) { for (unsigned i = 0; i < instr->num_components; i++) {
if (ctx->ac.chip_class >= GFX9) {
args[0] = ctx->esgs_ring; LLVMValueRef dw_addr = ctx->gs_vtx_offset[vtx_offset_param];
args[1] = vtx_offset; dw_addr = LLVMBuildAdd(ctx->ac.builder, dw_addr,
args[2] = LLVMConstInt(ctx->i32, (param * 4 + i + const_index) * 256, false); LLVMConstInt(ctx->ac.i32, param * 4 + i, 0), "");
args[3] = ctx->i32zero; value[i] = lds_load(ctx, dw_addr);
args[4] = ctx->i32one; /* OFFEN */ } else {
args[5] = ctx->i32zero; /* IDXEN */ args[0] = ctx->esgs_ring;
args[6] = ctx->i32one; /* GLC */ args[1] = vtx_offset;
args[7] = ctx->i32zero; /* SLC */ args[2] = LLVMConstInt(ctx->i32, (param * 4 + i + const_index) * 256, false);
args[8] = ctx->i32zero; /* TFE */ args[3] = ctx->i32zero;
args[4] = ctx->i32one; /* OFFEN */
value[i] = ac_build_intrinsic(&ctx->ac, "llvm.SI.buffer.load.dword.i32.i32", args[5] = ctx->i32zero; /* IDXEN */
ctx->i32, args, 9, args[6] = ctx->i32one; /* GLC */
AC_FUNC_ATTR_READONLY | args[7] = ctx->i32zero; /* SLC */
AC_FUNC_ATTR_LEGACY); args[8] = ctx->i32zero; /* TFE */
value[i] = ac_build_intrinsic(&ctx->ac, "llvm.SI.buffer.load.dword.i32.i32",
ctx->i32, args, 9,
AC_FUNC_ATTR_READONLY |
AC_FUNC_ATTR_LEGACY);
}
} }
result = ac_build_gather_values(&ctx->ac, value, instr->num_components); result = ac_build_gather_values(&ctx->ac, value, instr->num_components);
......
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