gallium: Add a pipe cap for arb_cull_distance
authorTobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Sun, 8 May 2016 20:44:07 +0000 (22:44 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 13 May 2016 22:28:17 +0000 (08:28 +1000)
This lets us safely enable or disable the extension as needed

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 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/include/pipe/p_defines.h

index 94510757254cb7621d83f4227b12a72120190fe3..315a6a1566aa0db03de3dc8e78d3ec34c46a10b6 100644 (file)
@@ -336,6 +336,8 @@ The integer capabilities:
   PIPE_CONTEXT_ROBUST_BUFFER_ACCESS. See the ARB_robust_buffer_access_behavior
   extension for information on the required behavior for out of bounds accesses
   and accesses to unbound resources.
+* ``PIPE_CAP_CULL_DISTANCE``: Whether the driver supports the arb_cull_distance
+  extension and thus implements proper support for culling planes.
 
 
 .. _pipe_capf:
index fee44fa584c16ff0a9d7fb2976a33bb3690f548a..916151c52c3b8cbc277adcc01459dcfc50791eb9 100644 (file)
@@ -257,6 +257,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
        case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
        case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+       case PIPE_CAP_CULL_DISTANCE:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 9b6a6604965a3a96bb6861e7dd22cc8199edf8d7..802b25f2468efdd0a2a1cb23eb1d7d3ac6177350 100644 (file)
@@ -271,6 +271,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_PCI_FUNCTION:
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
    case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+   case PIPE_CAP_CULL_DISTANCE:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 2fc1873b2791a3fe53cf12af51afd3c23d8110fe..ddeebc982e626b9f0b18770ac441543cc0f22787 100644 (file)
@@ -500,6 +500,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PCI_FUNCTION:
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
    case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+   case PIPE_CAP_CULL_DISTANCE:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 4f61de8000f9bc218b9647eaa0f5414a80521bae..c6c18ee711796bc81b3b209e311dc67172f3959e 100644 (file)
@@ -321,6 +321,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PCI_FUNCTION:
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
    case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+   case PIPE_CAP_CULL_DISTANCE:
       return 0;
    }
    /* should only get here on unhandled cases */
index 400e9f5c04d412910db2c45cd1af69ffbc6dc539..87c344909ab3d9da2e77cb65530ef5f32280d857 100644 (file)
@@ -194,6 +194,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_PCI_FUNCTION:
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
    case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+   case PIPE_CAP_CULL_DISTANCE:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index ef114e505299db210a4cbe9e2c2fff757bf6cc5c..091215057d5c6bdcfc78e513309a098bfd0116f3 100644 (file)
@@ -247,6 +247,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_PCI_FUNCTION:
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
    case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+   case PIPE_CAP_CULL_DISTANCE:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index b8f7cb10887d6682b37fb8abc7066af2d94225db..eaf9c78d24be4bdf41c0fa699773b04650ab6386 100644 (file)
@@ -259,6 +259,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_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+   case PIPE_CAP_CULL_DISTANCE:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index eae53e16a543efc2ab7400dc56bdb93d0096b837..47dc275104ff81d9f9991289de1d837203888470 100644 (file)
@@ -216,6 +216,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_QUERY_MEMORY_INFO:
         case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
        case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+        case PIPE_CAP_CULL_DISTANCE:
             return 0;
 
         /* SWTCL-only features. */
index 98c5a89f7d1fecc74c3e04abd0fb05ec2edfd87f..06207274502f3e791e738f35a091170f5786ebb9 100644 (file)
@@ -366,6 +366,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_STRING_MARKER:
        case PIPE_CAP_QUERY_BUFFER_OBJECT:
        case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+       case PIPE_CAP_CULL_DISTANCE:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index f2692dc9058649bf6a4e08b3b144994a4fad4fbb..1f6cbf7d857e998f54fa8ee203b790712997831e 100644 (file)
@@ -391,6 +391,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_CULL_DISTANCE:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index 031602bafc03ba7634e8ce11d4a283bf4568cd81..103e665e882ca25541d94fd3693ce6eb6bf233ea 100644 (file)
@@ -272,6 +272,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
    case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+   case PIPE_CAP_CULL_DISTANCE:
       return 0;
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
       return 4;
index d1bf6a31279b5b6d4f2edbb7e59e72a59e634a9e..fb03b56a15a81c1aaeda6c308ebbb7cbc0583679 100644 (file)
@@ -406,6 +406,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
    case PIPE_CAP_QUERY_BUFFER_OBJECT:
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
+   case PIPE_CAP_CULL_DISTANCE:
       return 0;
    }
 
index 4dc84d4ea62baef8574485318dd7c2c55687facd..86c2c3b94cc3aefeeda47ecf7442d18e5cac000a 100644 (file)
@@ -209,6 +209,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_PCI_FUNCTION:
         case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
         case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+        case PIPE_CAP_CULL_DISTANCE:
                 return 0;
 
                 /* Stream output. */
index 0cea2e3dadddc810f8890f9c10bc480c34c4f163..c23102258a944d62c54b0bca5112384d9a8f834a 100644 (file)
@@ -726,6 +726,7 @@ enum pipe_cap
    PIPE_CAP_PCI_FUNCTION,
    PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT,
    PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR,
+   PIPE_CAP_CULL_DISTANCE,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)