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

Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Bas Nieuwenhuizen
2017-10-20 01:40:31 +02:00
committed by Dave Airlie
parent ec53e52742
commit d4ecc3c929
+7 -1
View File
@@ -3008,7 +3008,12 @@ 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) {
LLVMValueRef dw_addr = ctx->gs_vtx_offset[vtx_offset_param];
dw_addr = LLVMBuildAdd(ctx->ac.builder, dw_addr,
LLVMConstInt(ctx->ac.i32, param * 4 + i, 0), "");
value[i] = lds_load(ctx, dw_addr);
} else {
args[0] = ctx->esgs_ring; args[0] = ctx->esgs_ring;
args[1] = vtx_offset; args[1] = vtx_offset;
args[2] = LLVMConstInt(ctx->i32, (param * 4 + i + const_index) * 256, false); args[2] = LLVMConstInt(ctx->i32, (param * 4 + i + const_index) * 256, false);
@@ -3024,6 +3029,7 @@ load_gs_input(struct nir_to_llvm_context *ctx,
AC_FUNC_ATTR_READONLY | AC_FUNC_ATTR_READONLY |
AC_FUNC_ATTR_LEGACY); 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);
return result; return result;