gallium: add an interface for EXT_depth_bounds_test
authorMarek Olšák <marek.olsak@amd.com>
Mon, 10 Aug 2015 00:11:48 +0000 (02:11 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 14 Aug 2015 13:01:51 +0000 (15:01 +0200)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.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/include/pipe/p_defines.h
src/gallium/include/pipe/p_state.h

index c0b5eb31d055ccb1608b55d88f01472d35918de8..2c0da016d08c474c2bb3bbe52f4c04072f2ff3cc 100644 (file)
@@ -264,6 +264,9 @@ The integer capabilities:
 * ``PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR``: Whether the linear minification and
   magnification filters are supported with half-precision floating-point
   textures.
+* ``PIPE_CAP_DEPTH_BOUNDS_TEST``: Whether bounds_test, bounds_min, and
+  bounds_max states of pipe_depth_stencil_alpha_state behave according
+  to the GL_EXT_depth_bounds_test specification.
 
 
 .. _pipe_capf:
index 295ce7e81875f419177e6c237c9db4a12a9d5101..b55f5b36ca93fe178363bf93970a7a1b1535c577 100644 (file)
@@ -232,6 +232,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
        case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
        case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
+       case PIPE_CAP_DEPTH_BOUNDS_TEST:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 7608ca5e1a9b2eaeae1b57a9131990986fe4f41e..19a94a8e019b905ce9d6a20ddb83c02763217b96 100644 (file)
@@ -246,6 +246,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
    case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
    case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
+   case PIPE_CAP_DEPTH_BOUNDS_TEST:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 9f150bbd7b2c18ff45e8d19c21ba4eba85e5c27b..ab4d1377c9f4c64c6e56f2588e73e5943d1f5936 100644 (file)
@@ -468,6 +468,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+   case PIPE_CAP_DEPTH_BOUNDS_TEST:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 539bb448bc6f0bf0ef36649347855e123d27c993..14eeab03387c2e404bf5730f24d597cd76243e1c 100644 (file)
@@ -295,6 +295,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+   case PIPE_CAP_DEPTH_BOUNDS_TEST:
       return 0;
    }
    /* should only get here on unhandled cases */
index 73bcd5b0d3ffc32cf6c426cb423ae940f4548f69..efa766d4a69e4d2ffbfeb5f3a0ab6d363a6630a1 100644 (file)
@@ -166,6 +166,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
    case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
    case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
+   case PIPE_CAP_DEPTH_BOUNDS_TEST:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 1e1987745935daffcee1dbf1d0bac78c59e18cd4..2479cbd664e7abbbbc860f78e6dec8d22667542f 100644 (file)
@@ -213,6 +213,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+   case PIPE_CAP_DEPTH_BOUNDS_TEST:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 0c25ec4312016fd19819c54b02f85c15a9716b7e..54b469bc03ea0e51525a1b43f0445122a2a00e74 100644 (file)
@@ -199,6 +199,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_VERTEXID_NOBASE:
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
+   case PIPE_CAP_DEPTH_BOUNDS_TEST:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 74aae379c09be43463eba2d016b4ac4f1ded3bfb..4ca0b268bdeb325c7491996c3cbe28c909a59016 100644 (file)
@@ -194,6 +194,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
         case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
         case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
+        case PIPE_CAP_DEPTH_BOUNDS_TEST:
             return 0;
 
         /* SWTCL-only features. */
index a0fe1d355c911879c9955f8b79d47a32659c5cc6..6ffe5615fbfac522622160458b15fe13297c7c16 100644 (file)
@@ -339,6 +339,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_SAMPLER_VIEW_TARGET:
        case PIPE_CAP_VERTEXID_NOBASE:
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+       case PIPE_CAP_DEPTH_BOUNDS_TEST:
                return 0;
 
        /* Stream output. */
index d60c258709d485dc1025863b6da648e24b1d6a8a..f0a377b78b052b812a783d2584a832da53f8e60e 100644 (file)
@@ -301,6 +301,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
        case PIPE_CAP_SAMPLER_VIEW_TARGET:
        case PIPE_CAP_VERTEXID_NOBASE:
+       case PIPE_CAP_DEPTH_BOUNDS_TEST:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index 49a21d9c06b26ce88b35104297f8491bade48fc4..0bfd9c3578ce7f97e44afa16c6e8a00919b06f38 100644 (file)
@@ -245,6 +245,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+   case PIPE_CAP_DEPTH_BOUNDS_TEST:
       return 0;
    }
    /* should only get here on unhandled cases */
index 7b70272a82843093fdc3a470828eedf4fa5e7e34..66c3deaa9e7be6774f0f60b3f5c4890794c6ae9d 100644 (file)
@@ -312,6 +312,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
    case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
    case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
+   case PIPE_CAP_DEPTH_BOUNDS_TEST:
       return 0;
    }
 
index 72f08262b662aae12f8bb8bf4e42506530cf8167..2dee1d40e5f4f76654d7058cdf964ece0cd060e5 100644 (file)
@@ -179,6 +179,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
        case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
        case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
+       case PIPE_CAP_DEPTH_BOUNDS_TEST:
                 return 0;
 
                 /* Stream output. */
index 83a3e2bb3775e9efd7748b7e5e2e46f2dfa7e6e9..2ba56eac7933834f31f0a8d7b55a62cf51b6aace 100644 (file)
@@ -609,6 +609,7 @@ enum pipe_cap
    PIPE_CAP_MAX_SHADER_PATCH_VARYINGS,
    PIPE_CAP_TEXTURE_FLOAT_LINEAR,
    PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR,
+   PIPE_CAP_DEPTH_BOUNDS_TEST,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
index a233610ead6a40123ad2ddd1d62f39889ecb21a5..1e493f47ccf63c8eaa8e05585c4d53e480f03ac9 100644 (file)
@@ -223,6 +223,9 @@ struct pipe_depth_state
    unsigned enabled:1;         /**< depth test enabled? */
    unsigned writemask:1;       /**< allow depth buffer writes? */
    unsigned func:3;            /**< depth test func (PIPE_FUNC_x) */
+   unsigned bounds_test:1;     /**< depth bounds test enabled? */
+   float bounds_min;           /**< minimum depth bound */
+   float bounds_max;           /**< maximum depth bound */
 };