diff options
author | Tom Stellard <[email protected]> | 2016-08-26 19:49:13 +0000 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2016-08-29 16:36:46 +0000 |
commit | 63ed11cde9987e438bf28ef74879e2700971eb26 (patch) | |
tree | f7f15dff13ca8fcd6cc9359f8f235a2762ed530b /src/gallium/drivers/radeonsi/si_shader.c | |
parent | f48ccb8c075f18338d44078fa1be81a2e8a46970 (diff) |
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 <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index a5b566e5489..12f2df9bfe0 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/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) |