[Mesa-dev] [PATCH 1/2] gallium: add PIPE_CAP_MIXED_FRAMEBUFFER_SIZES

Roland Scheidegger sroland at vmware.com
Mon Sep 9 04:31:16 PDT 2013


I'm not really convinced of this idea.
There's already PIPE_CAP_MIXED_COLORBUFFER_FORMATS which is sort of
similar - a "requirement" of ARB_fbo, but it isn't used to determine
support of ARB_fbo or not (my guess is drivers want to advertize ARB_fbo
even if they can't do it, and ARB_fbo doesn't really have a hard
requirement for anything as you always can say "no" to fb supported).
So I can't see why not supporting different width/height is treated
different to not supporting different formats.
(For that matter I'm not sure if a new cap bit is needed not supporting
different formats might affect exactly the same drivers as not
supporting different width/height though I'm not sure of that. In any
case though I guess the way the fb validation is done, that is without
any direct driver feedback, it will remain problematic for drivers which
can't support everything always.)

Roland


Am 08.09.2013 05:00, schrieb Ilia Mirkin:
> This CAP will determine whether ARB_framebuffer_object can be enabled.
> The nv30 driver does not allow mixing swizzled and linear zsbuf/cbufs.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> 
> Christoph, this is what I understood you suggested I do. Hopefully I got it
> right. I've split this up into two patches, one that adds the cap, one that
> actually makes use of it, feel free to squash them together if you prefer.
> 
> My explanation of the cap in screen.rst is not great, largely due to my lack
> of understanding of the major issue, i.e. precisely what can't be mixed. Feel
> free to reword, or let me know a better wording and I can resend the patch.
> 
> By fiddling with the cap being on and off, I was able to test that it
> correctly affects ARB_framebuffer_object being exposed/hidden (with the second
> patch in place).
> 
>  src/gallium/docs/source/screen.rst           | 4 ++++
>  src/gallium/drivers/i915/i915_screen.c       | 1 +
>  src/gallium/drivers/ilo/ilo_screen.c         | 1 +
>  src/gallium/drivers/llvmpipe/lp_screen.c     | 1 +
>  src/gallium/drivers/nv30/nv30_screen.c       | 1 +
>  src/gallium/drivers/nv50/nv50_screen.c       | 1 +
>  src/gallium/drivers/nvc0/nvc0_screen.c       | 1 +
>  src/gallium/drivers/r300/r300_screen.c       | 1 +
>  src/gallium/drivers/r600/r600_pipe.c         | 1 +
>  src/gallium/drivers/radeonsi/radeonsi_pipe.c | 1 +
>  src/gallium/drivers/softpipe/sp_screen.c     | 1 +
>  src/gallium/drivers/svga/svga_screen.c       | 1 +
>  src/gallium/include/pipe/p_defines.h         | 3 ++-
>  13 files changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
> index d19cd1a..238cc62 100644
> --- a/src/gallium/docs/source/screen.rst
> +++ b/src/gallium/docs/source/screen.rst
> @@ -173,6 +173,10 @@ The integer capabilities:
>    viewport/scissor combination.  
>  * ''PIPE_CAP_ENDIANNESS``:: The endianness of the device.  Either
>    PIPE_ENDIAN_BIG or PIPE_ENDIAN_LITTLE.
> +* ``PIPE_CAP_MIXED_FRAMEBUFFER_SIZES``: Whether it is possible to mix
> +  framebuffer sizes. This controls whether ARB_framebuffer_object is
> +  provided. For example NV30/NV40 is unable to deal with swizzled and linear
> +  formats at the same time.
>  
>  
>  .. _pipe_capf:
> diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
> index 556dda8..77607d0 100644
> --- a/src/gallium/drivers/i915/i915_screen.c
> +++ b/src/gallium/drivers/i915/i915_screen.c
> @@ -172,6 +172,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
>     /* Supported features (boolean caps). */
>     case PIPE_CAP_ANISOTROPIC_FILTER:
>     case PIPE_CAP_NPOT_TEXTURES:
> +   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>     case PIPE_CAP_POINT_SPRITE:
>     case PIPE_CAP_PRIMITIVE_RESTART: /* draw module */
>     case PIPE_CAP_TEXTURE_SHADOW_MAP:
> diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c
> index 3f8d431..ddf11ff 100644
> --- a/src/gallium/drivers/ilo/ilo_screen.c
> +++ b/src/gallium/drivers/ilo/ilo_screen.c
> @@ -286,6 +286,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
>  
>     switch (param) {
>     case PIPE_CAP_NPOT_TEXTURES:
> +   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>     case PIPE_CAP_TWO_SIDED_STENCIL:
>        return true;
>     case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
> diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
> index b3cd77f..2bbc2c9 100644
> --- a/src/gallium/drivers/llvmpipe/lp_screen.c
> +++ b/src/gallium/drivers/llvmpipe/lp_screen.c
> @@ -109,6 +109,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
>     case PIPE_CAP_MAX_COMBINED_SAMPLERS:
>        return 2 * PIPE_MAX_SAMPLERS;  /* VS + FS samplers */
>     case PIPE_CAP_NPOT_TEXTURES:
> +   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>        return 1;
>     case PIPE_CAP_TWO_SIDED_STENCIL:
>        return 1;
> diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c
> index 39e64ce..1b3bcbd 100644
> --- a/src/gallium/drivers/nv30/nv30_screen.c
> +++ b/src/gallium/drivers/nv30/nv30_screen.c
> @@ -125,6 +125,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>     case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
>     case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
>     case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
> +   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>        return 0;
>     case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
>     case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
> diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
> index 1f52594..d4c787d 100644
> --- a/src/gallium/drivers/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nv50/nv50_screen.c
> @@ -103,6 +103,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>     case PIPE_CAP_TEXTURE_SWIZZLE:
>     case PIPE_CAP_TEXTURE_SHADOW_MAP:
>     case PIPE_CAP_NPOT_TEXTURES:
> +   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>     case PIPE_CAP_ANISOTROPIC_FILTER:
>     case PIPE_CAP_SCALED_RESOLVE:
>     case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
> diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
> index 1de07ff..6aa5543 100644
> --- a/src/gallium/drivers/nvc0/nvc0_screen.c
> +++ b/src/gallium/drivers/nvc0/nvc0_screen.c
> @@ -88,6 +88,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>     case PIPE_CAP_TEXTURE_SWIZZLE:
>     case PIPE_CAP_TEXTURE_SHADOW_MAP:
>     case PIPE_CAP_NPOT_TEXTURES:
> +   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>     case PIPE_CAP_ANISOTROPIC_FILTER:
>     case PIPE_CAP_SEAMLESS_CUBE_MAP:
>     case PIPE_CAP_CUBE_MAP_ARRAY:
> diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
> index 063bc09..7ac68fa 100644
> --- a/src/gallium/drivers/r300/r300_screen.c
> +++ b/src/gallium/drivers/r300/r300_screen.c
> @@ -89,6 +89,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
>      switch (param) {
>          /* Supported features (boolean caps). */
>          case PIPE_CAP_NPOT_TEXTURES:
> +        case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>          case PIPE_CAP_TWO_SIDED_STENCIL:
>          case PIPE_CAP_ANISOTROPIC_FILTER:
>          case PIPE_CAP_POINT_SPRITE:
> diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
> index aa5cadf..5a4ee2a 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -544,6 +544,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
>  	switch (param) {
>  	/* Supported features (boolean caps). */
>  	case PIPE_CAP_NPOT_TEXTURES:
> +	case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>  	case PIPE_CAP_TWO_SIDED_STENCIL:
>  	case PIPE_CAP_ANISOTROPIC_FILTER:
>  	case PIPE_CAP_POINT_SPRITE:
> diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
> index 6ca138f..b6f3ff5 100644
> --- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c
> +++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
> @@ -373,6 +373,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
>  	case PIPE_CAP_USER_CONSTANT_BUFFERS:
>  	case PIPE_CAP_START_INSTANCE:
>  	case PIPE_CAP_NPOT_TEXTURES:
> +	case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>          case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
>  	case PIPE_CAP_TGSI_INSTANCEID:
>  	case PIPE_CAP_COMPUTE:
> diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
> index 4762ac3..47ef20e 100644
> --- a/src/gallium/drivers/softpipe/sp_screen.c
> +++ b/src/gallium/drivers/softpipe/sp_screen.c
> @@ -69,6 +69,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
>     case PIPE_CAP_MAX_COMBINED_SAMPLERS:
>        return 2 * PIPE_MAX_SAMPLERS;  /* VS + FS */
>     case PIPE_CAP_NPOT_TEXTURES:
> +   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>        return 1;
>     case PIPE_CAP_TWO_SIDED_STENCIL:
>        return 1;
> diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
> index 40b35cc..0eef024 100644
> --- a/src/gallium/drivers/svga/svga_screen.c
> +++ b/src/gallium/drivers/svga/svga_screen.c
> @@ -141,6 +141,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
>     case PIPE_CAP_MAX_COMBINED_SAMPLERS:
>        return 16;
>     case PIPE_CAP_NPOT_TEXTURES:
> +   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
>        return 1;
>     case PIPE_CAP_TWO_SIDED_STENCIL:
>        return 1;
> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
> index 63869c9..db6db32 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -512,7 +512,8 @@ enum pipe_cap {
>     PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK = 82,
>     PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE = 83,
>     PIPE_CAP_MAX_VIEWPORTS = 84,
> -   PIPE_CAP_ENDIANNESS = 85
> +   PIPE_CAP_ENDIANNESS = 85,
> +   PIPE_CAP_MIXED_FRAMEBUFFER_SIZES = 86
>  };
>  
>  #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
> 


More information about the mesa-dev mailing list