Re: [Mesa-dev] [PATCH] radeonsi: Don't use global variables for tess lds
On Mon, Aug 29, 2016 at 2:21 AM, Edward O'Callaghanwrote: > Missing Signoff-by line but otherwise with that fix, Signed-off-by isn't required in Mesa. The patch is: Reviewed-by: Marek Olšák Marek > > Reviewed-By: Edward O'Callaghan > > On 08/27/2016 05:52 AM, Tom Stellard wrote: >> 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. >> --- >> src/gallium/drivers/radeonsi/si_shader.c | 15 ++- >> 1 file changed, 6 insertions(+), 9 deletions(-) >> >> diff --git a/src/gallium/drivers/radeonsi/si_shader.c >> b/src/gallium/drivers/radeonsi/si_shader.c >> index 64c367e..5d972cb 100644 >> --- a/src/gallium/drivers/radeonsi/si_shader.c >> +++ b/src/gallium/drivers/radeonsi/si_shader.c >> @@ -5420,16 +5420,13 @@ static unsigned llvm_get_type_size(LLVMTypeRef type) >> static void declare_tess_lds(struct si_shader_context *ctx) >> { >> struct gallivm_state *gallivm = >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 = >radeon_bld.soa.bld_base; >> + struct lp_build_context *uint = _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) >> > > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] radeonsi: Don't use global variables for tess lds
Missing Signoff-by line but otherwise with that fix, Reviewed-By: Edward O'CallaghanOn 08/27/2016 05:52 AM, Tom Stellard wrote: > 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. > --- > src/gallium/drivers/radeonsi/si_shader.c | 15 ++- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/src/gallium/drivers/radeonsi/si_shader.c > b/src/gallium/drivers/radeonsi/si_shader.c > index 64c367e..5d972cb 100644 > --- a/src/gallium/drivers/radeonsi/si_shader.c > +++ b/src/gallium/drivers/radeonsi/si_shader.c > @@ -5420,16 +5420,13 @@ static unsigned llvm_get_type_size(LLVMTypeRef type) > static void declare_tess_lds(struct si_shader_context *ctx) > { > struct gallivm_state *gallivm = >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 = >radeon_bld.soa.bld_base; > + struct lp_build_context *uint = _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) > signature.asc Description: OpenPGP digital signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] 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. --- src/gallium/drivers/radeonsi/si_shader.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 64c367e..5d972cb 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -5420,16 +5420,13 @@ static unsigned llvm_get_type_size(LLVMTypeRef type) static void declare_tess_lds(struct si_shader_context *ctx) { struct gallivm_state *gallivm = >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 = >radeon_bld.soa.bld_base; + struct lp_build_context *uint = _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) -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev