[Mesa-dev] [PATCH] llvmpipe: increase max texture size to 2GB

Roland Scheidegger sroland at vmware.com
Thu Oct 10 23:31:52 UTC 2019


Am 10.10.19 um 20:52 schrieb Jose Fonseca:
> Sounds great.
> 
> Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
> 
> BTW, it's not really difficult to do gather with unsigned offsets: add
> 0x80000000 to the base, subtract 0x8000000 to the offsets, and use the
> signed gather.   If the cost of doing so is significant, we could do
> this just for large textures, by adding a bit per texture to the shader key.
Right, that should work. I guess the cost should be insignificant
(although might make debugging harder?). Theoretically the base address
adjustment could even be done outside the shader (though that would be
looking a bit odd, in any case it's just a single scalar add per jit
invocation), and the offset adjustment could be done while the offsets
are still vectorized.

Roland


> 
> Jose
> 
> 
> ------------------------------------------------------------------------
> *From:* sroland at vmware.com <sroland at vmware.com>
> *Sent:* Thursday, October 10, 2019 19:18
> *To:* Jose Fonseca <jfonseca at vmware.com>; mesa-dev at lists.freedesktop.org
> <mesa-dev at lists.freedesktop.org>
> *Cc:* Roland Scheidegger <sroland at vmware.com>
> *Subject:* [PATCH] llvmpipe: increase max texture size to 2GB
>  
> From: Roland Scheidegger <sroland at vmware.com>
> 
> The 1GB limit was arbitrary, increase this to 2GB (which is the max
> possible without code changes).
> ---
>  src/gallium/drivers/llvmpipe/lp_limits.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/llvmpipe/lp_limits.h
> b/src/gallium/drivers/llvmpipe/lp_limits.h
> index c2808162c78..569179ecdf4 100644
> --- a/src/gallium/drivers/llvmpipe/lp_limits.h
> +++ b/src/gallium/drivers/llvmpipe/lp_limits.h
> @@ -43,7 +43,11 @@
>  /**
>   * Max texture sizes
>   */
> -#define LP_MAX_TEXTURE_SIZE (1 * 1024 * 1024 * 1024ULL)  /* 1GB for now */
> +/**
> + * 2GB is the actual max currently (we always use 32bit offsets, and both
> + * llvm GEP as well as avx2 gather use signed offsets).
> + */
> +#define LP_MAX_TEXTURE_SIZE (2 * 1024 * 1024 * 1024ULL)
>  #define LP_MAX_TEXTURE_2D_LEVELS 14  /* 8K x 8K for now */
>  #define LP_MAX_TEXTURE_3D_LEVELS 12  /* 2K x 2K x 2K for now */
>  #define LP_MAX_TEXTURE_CUBE_LEVELS 14  /* 8K x 8K for now */
> -- 
> 2.17.1
> 



More information about the mesa-dev mailing list