gallium: introduce PIPE_CAP_CLIP_HALFZ.
authorMathias Fröhlich <Mathias.Froehlich@gmx.net>
Sun, 14 Sep 2014 13:17:07 +0000 (15:17 +0200)
committerMathias Fröhlich <Mathias.Froehlich@gmx.net>
Fri, 24 Oct 2014 17:21:21 +0000 (19:21 +0200)
In preparation of ARB_clip_control. Let the driver decide if
it supports pipe_rasterizer_state::clip_halfz being set to true.

v3:
Initially enable on ilo.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de
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 88d7e4924f2276a85e824c15dcfc523d8ff706e2..e711ad40befdd308d3d6f90e9661a38216c14a13 100644 (file)
@@ -230,6 +230,9 @@ The integer capabilities:
   different than the underlying resource's, as permitted by
   ARB_texture_view. For example a 2d array texture may be reinterpreted as a
   cube (array) texture and vice-versa.
+* ``PIPE_CAP_CLIP_HALFZ``: Whether the driver supports the
+  pipe_rasterizer_state::clip_halfz being set to true. This is required
+  for enabling ARB_clip_control.
 
 
 .. _pipe_capf:
index 90156b49cb60df5bdd5d9ade3c311dd20fa9b411..7a3cd952ce265913775a6b8e85b4a4879974ca9a 100644 (file)
@@ -226,6 +226,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
        case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
        case PIPE_CAP_SAMPLER_VIEW_TARGET:
+       case PIPE_CAP_CLIP_HALFZ:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 2a6e7518b0e1fa852e7deb32573d6936ff68cbf5..062f1a661cfaf148f222a106da266b07114cc10a 100644 (file)
@@ -225,6 +225,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
    case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
+   case PIPE_CAP_CLIP_HALFZ:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 48c3dea2d7ea949a3964798b3bcca1352da529f5..da6cf7669adc9539a278ec7ab39e69a2a07e2b4b 100644 (file)
@@ -469,6 +469,8 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    }
    case PIPE_CAP_UMA:
       return true;
+   case PIPE_CAP_CLIP_HALFZ:
+      return true;
 
    default:
       return 0;
index ad716b70ca57265a9958a34f23f691a8e8fa0857..cec0fcbf23b2795cfded1a58df0c78c63d00e0ae 100644 (file)
@@ -277,6 +277,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    }
    case PIPE_CAP_UMA:
       return 0;
+   case PIPE_CAP_CLIP_HALFZ:
+      return 1;
    }
    /* should only get here on unhandled cases */
    debug_printf("Unexpected PIPE_CAP %d query\n", param);
index 700b9bbfe095682c8406dc298cacfdf6cf3eedfb..2b65f8cdaa0c9203c85422c3ce8c4753af97d1b7 100644 (file)
@@ -156,6 +156,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
+   case PIPE_CAP_CLIP_HALFZ:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index d26a438378c80a426e8f4ae4ced10f06dd76deac..4ee598032f22dc923a0837db992967ac39d5c6ff 100644 (file)
@@ -204,6 +204,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_COMPUTE:
    case PIPE_CAP_DRAW_INDIRECT:
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
+   case PIPE_CAP_CLIP_HALFZ:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index a673eb92035086fde0dd4faa7cd239ddabb2c8f8..88fc9264829f2786a9afd85f5eb896f33ba41670 100644 (file)
@@ -188,6 +188,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT:
    case PIPE_CAP_FAKE_SW_MSAA:
    case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
+   case PIPE_CAP_CLIP_HALFZ:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index db9ad15983cb74b5b7017cd576f54e1f357f7ef7..47616f65f3d38638471f23a58630644a5bffec94 100644 (file)
@@ -107,6 +107,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_USER_CONSTANT_BUFFERS:
         case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
         case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
+        case PIPE_CAP_CLIP_HALFZ:
             return 1;
 
         case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
index c5f01c09e92eb9dbfa5ad5deee4a2660a654be13..c86daa6c2493c2c8ea871301d24be2e2aa9de02c 100644 (file)
@@ -266,6 +266,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
        case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT:
        case PIPE_CAP_SAMPLE_SHADING:
+       case PIPE_CAP_CLIP_HALFZ:
                return 1;
 
        case PIPE_CAP_COMPUTE:
index 839711504e5dc7f6e3dda90d7c465f270a31dbbd..0577cd2a9247c0ebeceb7d5bc526da4161606220 100644 (file)
@@ -210,6 +210,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_CUBE_MAP_ARRAY:
        case PIPE_CAP_SAMPLE_SHADING:
        case PIPE_CAP_DRAW_INDIRECT:
+       case PIPE_CAP_CLIP_HALFZ:
                return 1;
 
        case PIPE_CAP_TEXTURE_MULTISAMPLE:
index a6e7fc0a4ca22248212f2c88ca17c40ad2379ed2..47126eff180505fda56fd31896433e1b8f6b20e6 100644 (file)
@@ -227,6 +227,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 0;
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
       return 1;
+   case PIPE_CAP_CLIP_HALFZ:
+      return 1;
    }
    /* should only get here on unhandled cases */
    debug_printf("Unexpected PIPE_CAP %d query\n", param);
index 587eaad07c8e30d2b1479b8fc67b18339d95c489..691d9df63c63e5b85205a6cd8e41556746c7d532 100644 (file)
@@ -281,6 +281,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
+   case PIPE_CAP_CLIP_HALFZ:
       return 0;
    case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
       return 64;
index 4c0455da0c0c4c606279d21bac2778d32431d9f5..b84b6b014f587f355335d304ccd6802d9eda3571 100644 (file)
@@ -164,6 +164,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
         case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
         case PIPE_CAP_SAMPLER_VIEW_TARGET:
+        case PIPE_CAP_CLIP_HALFZ:
                 return 0;
 
                 /* Stream output. */
index 42b6f3755e42d42e66f6540a4ffa90d388f2392b..8c4e415607ab521b78acbaba7a464b6d99927ea1 100644 (file)
@@ -571,6 +571,7 @@ enum pipe_cap {
    PIPE_CAP_CONDITIONAL_RENDER_INVERTED = 108,
    PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE = 109,
    PIPE_CAP_SAMPLER_VIEW_TARGET = 110,
+   PIPE_CAP_CLIP_HALFZ = 111,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)