[Mesa-dev] [PATCH 1/2] virgl: do not use SP_MAX_TEXTURE_*_LEVELS defines

Erik Faye-Lund erik.faye-lund at collabora.com
Tue Aug 14 17:40:16 UTC 2018


If you are referring to PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS, then that's 
already taken care of for virgl...

On Tue, Aug 14, 2018 at 6:00 PM, Marek Olšák <maraeo at gmail.com> wrote:
> I'm saying that the limit should be 16k except for the layer/slice 
> dimension where it can be 2k. See radeonsi.
> 
> Marek
> 
> On Tue, Aug 14, 2018, 11:57 AM Erik Faye-Lund 
> <erik.faye-lund at collabora.com> wrote:
>> What are you referring to, exactly? In OpenGL, texture size-limits 
>> are per axis, not in total...
>> 
>> On Tue, Aug 14, 2018 at 5:43 PM, Marek Olšák <maraeo at gmail.com> 
>> wrote:
>>> You could have a 3d or cube texture where 1 or 2 dimensions are 16k.
>>> 
>>> Marek
>>> 
>>> On Tue, Aug 14, 2018, 9:02 AM Erik Faye-Lund 
>>> <erik.faye-lund at collabora.com> wrote:
>>>> These macro-names are also used for softpipe, so let's avoid 
>>>> confusion
>>>> by avoiding them. Besides, they are just used in one place in 
>>>> virgl, so
>>>> let's just inline them into the place they are used instead.
>>>> 
>>>> While we're at it, fixup an error in the comment for the 3D 
>>>> version.
>>>> Mesa subtracts computes max-size by doing by 2^(n-1), which means 
>>>> this
>>>> should be 256 cubed, not 512 cubed. The other comments are correct.
>>>> 
>>>> Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
>>>> ---
>>>>  src/gallium/drivers/virgl/virgl_screen.c | 10 +++-------
>>>>  1 file changed, 3 insertions(+), 7 deletions(-)
>>>> 
>>>> diff --git a/src/gallium/drivers/virgl/virgl_screen.c 
>>>> b/src/gallium/drivers/virgl/virgl_screen.c
>>>> index 87ce3b7355..0ac976acbd 100644
>>>> --- a/src/gallium/drivers/virgl/virgl_screen.c
>>>> +++ b/src/gallium/drivers/virgl/virgl_screen.c
>>>> @@ -35,10 +35,6 @@
>>>>  #include "virgl_public.h"
>>>>  #include "virgl_context.h"
>>>> 
>>>> -#define SP_MAX_TEXTURE_2D_LEVELS 15  /* 16K x 16K */
>>>> -#define SP_MAX_TEXTURE_3D_LEVELS 9   /* 512 x 512 x 512 */
>>>> -#define SP_MAX_TEXTURE_CUBE_LEVELS 13  /* 4K x 4K */
>>>> -
>>>>  static const char *
>>>>  virgl_get_vendor(struct pipe_screen *screen)
>>>>  {
>>>> @@ -76,11 +72,11 @@ virgl_get_param(struct pipe_screen *screen, 
>>>> enum pipe_cap param)
>>>>     case PIPE_CAP_TEXTURE_SWIZZLE:
>>>>        return 1;
>>>>     case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
>>>> -      return SP_MAX_TEXTURE_2D_LEVELS;
>>>> +      return 15; /* 16K x 16K */
>>>>     case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
>>>> -      return SP_MAX_TEXTURE_3D_LEVELS;
>>>> +      return 9; /* 256 x 256 x 256 */
>>>>     case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
>>>> -      return SP_MAX_TEXTURE_CUBE_LEVELS;
>>>> +      return 13; /* 4K x 4K */
>>>>     case PIPE_CAP_BLEND_EQUATION_SEPARATE:
>>>>        return 1;
>>>>     case PIPE_CAP_INDEP_BLEND_ENABLE:
>>>> --
>>>> 2.17.1
>>>> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180814/1d99272c/attachment-0001.html>


More information about the mesa-dev mailing list