瀏覽代碼

radeonsi: Don't use global variables for tess lds

We were allocating global variables for the maximum LDS size
which made the compiler think we were using all of LDS, which
isn't the case.

Reviewed-By: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
tags/13.0-branchpoint
Tom Stellard 10 年之前
父節點
當前提交
63ed11cde9
共有 1 個檔案被更改,包括 6 行新增 和 9 行删除
  1. 6
    9
      src/gallium/drivers/radeonsi/si_shader.c

+ 6
- 9
src/gallium/drivers/radeonsi/si_shader.c 查看文件

@@ -5413,16 +5413,13 @@ static unsigned llvm_get_type_size(LLVMTypeRef type)
static void declare_tess_lds(struct si_shader_context *ctx)
{
struct gallivm_state *gallivm = &ctx->radeon_bld.gallivm;
LLVMTypeRef i32 = ctx->radeon_bld.soa.bld_base.uint_bld.elem_type;
unsigned lds_size = ctx->screen->b.chip_class >= CIK ? 65536 : 32768;
struct lp_build_tgsi_context *bld_base = &ctx->radeon_bld.soa.bld_base;
struct lp_build_context *uint = &bld_base->uint_bld;

/* The actual size is computed outside of the shader to reduce
* the number of shader variants. */
ctx->lds =
LLVMAddGlobalInAddressSpace(gallivm->module,
LLVMArrayType(i32, lds_size / 4),
"tess_lds",
LOCAL_ADDR_SPACE);
unsigned lds_size = ctx->screen->b.chip_class >= CIK ? 65536 : 32768;
ctx->lds = LLVMBuildIntToPtr(gallivm->builder, uint->zero,
LLVMPointerType(LLVMArrayType(ctx->i32, lds_size / 4), LOCAL_ADDR_SPACE),
"tess_lds");
}

static void create_function(struct si_shader_context *ctx)

Loading…
取消
儲存