gallium: Add PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>
Wed, 17 Feb 2016 09:59:52 +0000 (20:59 +1100)
committerDave Airlie <airlied@redhat.com>
Thu, 7 Apr 2016 01:56:44 +0000 (11:56 +1000)
Add PIPE_CAP to determine if the GL extension
'GL_ARB_framebuffer_no_attachments' shall be
supported.

The driver is required to support 'PIPE_FORMAT_NONE'
via its 'is_format_supported()' callback in order
to determine the MSAA modes the hardware supports so
that values requested from the application using
'GL_ARB_framebuffer_no_attachments' may be quantized
to what the hardware expects.

V.2:
 Fix doc for a more detailed description of the PIPE_CAP
 and the corresponding GL constant.

V.3:
 Renamed and repurposed once again.

V.4:
 Remove CAP from cap_mapping array.

[airlied: fix damaged whitespace]

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/ilo/ilo_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nv30/nv30_screen.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index 47a19de6ea98a5b87a73670f4a8fb92921c6bce3..824f580ed447bbb8f2845bbdd2183aa4a91ebfe5 100644 (file)
@@ -323,6 +323,14 @@ The integer capabilities:
 * ``PIPE_CAP_PCI_BUS``: Return the PCI bus number.
 * ``PIPE_CAP_PCI_DEVICE``: Return the PCI device number.
 * ``PIPE_CAP_PCI_FUNCTION``: Return the PCI function number.
+* ``PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT``:
+  If non-zero, rendering to framebuffers with no surface attachments
+  is supported. The context->is_format_supported function will be expected
+  to be implemented with PIPE_FORMAT_NONE yeilding the MSAA modes the hardware
+  supports. N.B., The maximum number of layers supported for rasterizing a
+  primitive on a layer is obtained from ``PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS``
+  even though it can be larger than the number of layers supported by either
+  rendering or textures.
 
 
 .. _pipe_capf:
index d47cb07f10b0fa23bd27e8607ea430315daa3a80..707be17513b978dd8fa5a08ef98ec2f65ef683e4 100644 (file)
@@ -255,6 +255,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_INVALIDATE_BUFFER:
        case PIPE_CAP_GENERATE_MIPMAP:
        case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
+       case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index f4aa310ecdce35a18fe3bbbbf59fe09683fc24b7..68e32e51c34907a981a6e90bda647ef23cb082b9 100644 (file)
@@ -269,6 +269,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 7812c826250b43de7b7e8f132acf5c698c1bdf40..142d6f1fa21ca6059793f8ac245a7736b97483ee 100644 (file)
@@ -498,6 +498,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 2529b546564914888e06ec9ec8434565f0cc5911..6a5f906adc6500794d879183933c01d76880da60 100644 (file)
@@ -319,6 +319,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
    }
    /* should only get here on unhandled cases */
index b105c6aeb80eb4b0f8885bdcaca0de93965070b3..db7c2d15fb158140e459b039092c2f5032f07f55 100644 (file)
@@ -192,6 +192,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index ba5e5003b69811d43d6cfbcf0e22d5e18f0d96a2..20fb61b51f42cc7679e55e321a14cc75ff60a2bd 100644 (file)
@@ -245,6 +245,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index ec2340ee0c30def0cedf465bf5e99ab3ce88d8c4..c41912a60374e87a4bfae9f7601cf079d02b9967 100644 (file)
@@ -251,6 +251,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 1c3bb64f0e4025543f4b8e81787a6c9b2e6b6796..b3a7f049e108013c04ab0b86b92d54b5e6727728 100644 (file)
@@ -214,6 +214,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
         case PIPE_CAP_QUERY_BUFFER_OBJECT:
         case PIPE_CAP_QUERY_MEMORY_INFO:
+        case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
             return 0;
 
         /* SWTCL-only features. */
index c97e34121e38c3967bd753337c34141ac6ca9ef5..e6eec3bcf70d904edadf6d4f14af65d5d8a63eb4 100644 (file)
@@ -364,6 +364,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_GENERATE_MIPMAP:
        case PIPE_CAP_STRING_MARKER:
        case PIPE_CAP_QUERY_BUFFER_OBJECT:
+       case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index 407b9e19cc4670f4c48b2f39361b2f91622d5372..275b6767be474787481b65d4da039664a265f606 100644 (file)
@@ -356,6 +356,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_GENERATE_MIPMAP:
        case PIPE_CAP_STRING_MARKER:
        case PIPE_CAP_QUERY_BUFFER_OBJECT:
+       case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index bfd3598fc57b1bc6d45605f907b91324cbbb08cf..90f29d6e52a8446aac27d3e6b815b2d68d97e743 100644 (file)
@@ -270,6 +270,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
    }
    /* should only get here on unhandled cases */
index c0873c0c65a85a819f534f892889451694a71861..ccf794ecda71b0df59d904d7e73a07f08128edf0 100644 (file)
@@ -404,6 +404,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
    case PIPE_CAP_QUERY_BUFFER_OBJECT:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
    }
 
index 92d910ba6a5930137032dc03b108515766b24914..167a2f5bd8e902a2b0b5b5ed25c05a98c67bcb5e 100644 (file)
@@ -207,6 +207,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_PCI_BUS:
         case PIPE_CAP_PCI_DEVICE:
         case PIPE_CAP_PCI_FUNCTION:
+        case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
                 return 0;
 
                 /* Stream output. */
index 8126bdec40c960825d8d71957ac7a40add53aca0..5a5afc1712f89f94eacac777fa012a93f57ffa2b 100644 (file)
@@ -239,6 +239,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
+   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index 6f30f9ed7d3320ff13f9b1f4362736f6d8e5c398..5e204a3e5ead9eb7bc710f4537ca42a737b25e78 100644 (file)
@@ -690,6 +690,7 @@ enum pipe_cap
    PIPE_CAP_PCI_BUS,
    PIPE_CAP_PCI_DEVICE,
    PIPE_CAP_PCI_FUNCTION,
+   PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)