gallium: add PIPE_CAP_TGSI_ARRAY_COMPONENTS
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 7 Oct 2016 07:42:55 +0000 (09:42 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 12 Oct 2016 16:50:10 +0000 (18:50 +0200)
This is a screen cap because drivers are expected to support it either
for all shader types or for none of them.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
17 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/swr/swr_screen.cpp
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index cfc0a1b727a9cbbcc7ba2aa8efde01e94b5f4107..d79e75e2146cb5bc664ee4fd0242b573acf8aca7 100644 (file)
@@ -353,6 +353,14 @@ The integer capabilities:
   32-bit. If set to off, that means that a B5G6R5 + Z24 or RGBA8 + Z16
   combination will require a driver fallback, and should not be
   advertised in the GLX/EGL config list.
+* ``PIPE_CAP_TGSI_ARRAY_COMPONENTS``: If true, the driver interprets the
+  UsageMask of input and output declarations and allows declaring arrays
+  in overlapping ranges. The components must be a contiguous range, e.g. a
+  UsageMask of  xy or yzw is allowed, but xz or yw isn't. Declarations with
+  overlapping locations must have matching semantic names and indices, and
+  equal interpolation qualifiers.
+  Components may overlap, notably when the gaps in an array of dvec3 are
+  filled in.
 
 
 .. _pipe_capf:
index bc54539c676da2ab212225aa6555537fdfde11cb..1f7c2a5dc53de448dd22dd3fa0035d681adcf2eb 100644 (file)
@@ -287,6 +287,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_WINDOW_RECTANGLES:
        case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
        case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+       case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 9f801a9b850c11caae2a7eb01d46e5d493fe9937..003f85559f772acd66ef4bbee5dfc2cc54718530 100644 (file)
@@ -277,6 +277,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_TGSI_VOTE:
    case PIPE_CAP_MAX_WINDOW_RECTANGLES:
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 85357fa1fcb61ecc2a02645f8268bf839419a3fe..1904cd6e1fffeef12f1a9f52b4539e280597a16c 100644 (file)
@@ -515,6 +515,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_WINDOW_RECTANGLES:
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 9a0a1a24978031238ffc0c9bbfbf59ec4734210f..8da942865f45267a07015132bf5f0d4fc40b719e 100644 (file)
@@ -336,6 +336,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_WINDOW_RECTANGLES:
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
    }
    /* should only get here on unhandled cases */
index 2ced8f11ef6ef264f2250263cb25f99ed4e07aed..961c22c2f7ceb1924bdb268673c3c802f7a84201 100644 (file)
@@ -201,6 +201,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
    case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 6eb18eadc4705caa2606703ce8602b0587642222..99ad90a5ab0c49da4f35884fb252681698e56f03 100644 (file)
@@ -253,6 +253,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_VOTE:
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index afcb08ba6ef316003b2b9656c441e1d653921ce8..10110546a20b5c0e0b5c9d822f07a1f240483fab 100644 (file)
@@ -272,6 +272,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 4d416933319c77a77d92ffce91a2c703fd5c9e45..0b147f9b7e8d7d6363d21f28e823a55dac3e41d8 100644 (file)
@@ -223,6 +223,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_WINDOW_RECTANGLES:
         case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
         case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+        case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
             return 0;
 
         /* SWTCL-only features. */
index a3500804d8d5c9a3f2de3786c0cca0ecfdcb6629..95c6d997964602f0b4ce3f8aa2fb8becbdc86b9c 100644 (file)
@@ -373,6 +373,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
        case PIPE_CAP_TGSI_VOTE:
        case PIPE_CAP_MAX_WINDOW_RECTANGLES:
+       case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index 66eb2e16270822fcdb4e8c6a8bea54fc85921622..dc0c72e363c688b64ed000503d80a32b1ddbbe51 100644 (file)
@@ -458,6 +458,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
        case PIPE_CAP_TGSI_VOTE:
        case PIPE_CAP_MAX_WINDOW_RECTANGLES:
+       case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
                return 0;
 
        case PIPE_CAP_QUERY_BUFFER_OBJECT:
index 880480b581a7fb316d625fe82376a5c8a8d59fd3..a9a81de1a183e42791d97aa6752c6135b28b681c 100644 (file)
@@ -286,6 +286,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_WINDOW_RECTANGLES:
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
       return 4;
index 6d5c73b02954e8538f3f4dd85c39943200b2e46d..f969dd38203c4a434350cecfa1b9493f63dfd982 100644 (file)
@@ -417,6 +417,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_WINDOW_RECTANGLES:
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
    }
 
index 90fc77e39d334c830daf9ec338dc7347dbce1720..2495efb61bc6359fb6c9a818f8b74a913ec44070 100644 (file)
@@ -367,6 +367,7 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_WINDOW_RECTANGLES:
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
    }
 
index 045f3fb2a34a83248074f650b37b5fdd398c77c7..72fd09aee4fea002e22195fae5cb69efe00c42e8 100644 (file)
@@ -238,6 +238,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_WINDOW_RECTANGLES:
         case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
         case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+        case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
                 return 0;
 
                 /* Stream output. */
index 5f9875418906204b389e3c5387fe11434b0c3958..81935ec080da3a3ef9c274260531484dbe63f774 100644 (file)
@@ -248,6 +248,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_WINDOW_RECTANGLES:
    case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index db96c51088735e97a5b47069429f0cc701537f52..cdad415fd1980691dcf6e06a0580135c07d7e714 100644 (file)
@@ -737,6 +737,7 @@ enum pipe_cap
    PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED,
    PIPE_CAP_VIEWPORT_SUBPIXEL_BITS,
    PIPE_CAP_MIXED_COLOR_DEPTH_BITS,
+   PIPE_CAP_TGSI_ARRAY_COMPONENTS,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)