gallium: add a cap to determine whether the driver supports offset_clamp
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 1 Feb 2015 14:01:50 +0000 (09:01 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 3 Feb 2015 01:44:02 +0000 (20:44 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.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 55d114c829fc878338c46e446f4b48de7f2ed286..b72a372a6c3aeba5dae27d1f51f3e88587896c3f 100644 (file)
@@ -241,6 +241,8 @@ The integer capabilities:
   semantics. Only relevant if geometry shaders are supported.
   (Currently not possible to query availability of these two semantics outside
   this, at least BASEVERTEX should be exposed separately too).
+* ``PIPE_CAP_POLYGON_OFFSET_CLAMP``: If true, the driver implements support
+  for ``pipe_rasterizer_state::offset_clamp``.
 
 
 .. _pipe_capf:
index 084a0ec4e2a13cbf041a7038dc711d073f528954..b7bb859327c69452fa3e7d77b7236ed576681cdc 100644 (file)
@@ -229,6 +229,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_SAMPLER_VIEW_TARGET:
        case PIPE_CAP_CLIP_HALFZ:
        case PIPE_CAP_VERTEXID_NOBASE:
+       case PIPE_CAP_POLYGON_OFFSET_CLAMP:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 1277de313be45ae541b43b69517b7ddcb2999ed7..bbc901eed846fd697f2cae620102e1064e08c856 100644 (file)
@@ -227,6 +227,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
    case PIPE_CAP_CLIP_HALFZ:
    case PIPE_CAP_VERTEXID_NOBASE:
+   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 0c948f4dcd3aada6ecd87396c56f4d11e5c80f84..5048ba1ac22b23b0e91c31d9d976b38956be078e 100644 (file)
@@ -497,6 +497,8 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return true;
    case PIPE_CAP_VERTEXID_NOBASE:
       return false;
+   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
+      return true;
 
    default:
       return 0;
index 0e4456adc702c2e2e5fa2893d365941b97e40f76..3b316563ef28375162ed0c7474650a65b8b0a515 100644 (file)
@@ -284,6 +284,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_VERTEXID_NOBASE:
       return 0;
+   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
+      return 1;
    }
    /* should only get here on unhandled cases */
    debug_printf("Unexpected PIPE_CAP %d query\n", param);
index 46c21a1cfe1b8fe61dc12b26c9bf82e35d87e854..0a403ba15ffe26fc56e10ed1a4919e615476c284 100644 (file)
@@ -158,6 +158,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
    case PIPE_CAP_CLIP_HALFZ:
    case PIPE_CAP_VERTEXID_NOBASE:
+   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index da237f92d14aeb1f05fe9f32b8d207032229dac2..072a7a240e450c5f046fa400529eee9198232fc5 100644 (file)
@@ -174,6 +174,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
    case PIPE_CAP_CLIP_HALFZ:
+   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
       return 1;
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
       return 1; /* class_3d >= NVA0_3D_CLASS; */
index 1d7caf8c8c5928b2bf63a2421403b5fc62959d7d..cba19db71174ca2ed41c859efd05a7b2005f0403 100644 (file)
@@ -172,6 +172,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
    case PIPE_CAP_CLIP_HALFZ:
+   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
       return 1;
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
       return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
index f82010d766794a38f13c5c133cb8e7853ccb8428..434f4c439426b0e3ae45e5c90cc6dc68cf6c0292 100644 (file)
@@ -182,6 +182,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
         case PIPE_CAP_SAMPLER_VIEW_TARGET:
         case PIPE_CAP_VERTEXID_NOBASE:
+        case PIPE_CAP_POLYGON_OFFSET_CLAMP:
             return 0;
 
         /* SWTCL-only features. */
index b6f785976cedc8ab83f4e6192c262d2d4b590602..e3df024b0efca28ce854ff7e9e781d0082bc0227 100644 (file)
@@ -267,6 +267,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT:
        case PIPE_CAP_SAMPLE_SHADING:
        case PIPE_CAP_CLIP_HALFZ:
+       case PIPE_CAP_POLYGON_OFFSET_CLAMP:
                return 1;
 
        case PIPE_CAP_COMPUTE:
index eb2b785de53b5a72a713a2f5ac45994cae8b866b..eff8d6909597562849ebb0eecad60854909c1c45 100644 (file)
@@ -226,6 +226,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_DRAW_INDIRECT:
        case PIPE_CAP_CLIP_HALFZ:
        case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
+       case PIPE_CAP_POLYGON_OFFSET_CLAMP:
                return 1;
 
        case PIPE_CAP_TEXTURE_MULTISAMPLE:
index 8efc88fc2b7f708579f96444464017e6d003a14d..9aefb882b1332de342da20a4ce46807d8f40daf7 100644 (file)
@@ -233,6 +233,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_VERTEXID_NOBASE:
       return 0;
+   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
+      return 0;
    }
    /* should only get here on unhandled cases */
    debug_printf("Unexpected PIPE_CAP %d query\n", param);
index 32578c849e2b99e61422b483bc48ca9e6998057e..9e190e2b014f5f7d33b9f689fc21719a8ff7c6d6 100644 (file)
@@ -283,6 +283,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
    case PIPE_CAP_CLIP_HALFZ:
    case PIPE_CAP_VERTEXID_NOBASE:
+   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
       return 0;
    case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
       return 64;
index 8d216338bf7fdd84a4865c372b896938ca4d786f..9b5d7ba166c93c3e832a02b89691c7b0ffe6a8e6 100644 (file)
@@ -170,6 +170,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_SAMPLER_VIEW_TARGET:
         case PIPE_CAP_CLIP_HALFZ:
         case PIPE_CAP_VERTEXID_NOBASE:
+        case PIPE_CAP_POLYGON_OFFSET_CLAMP:
                 return 0;
 
                 /* Stream output. */
index 6c5703ad46fe42056c9207b8804d51874be620bc..fd32c4aaeafacd56eda4bc59ad0a32873eab2067 100644 (file)
@@ -572,7 +572,8 @@ enum pipe_cap {
    PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE = 109,
    PIPE_CAP_SAMPLER_VIEW_TARGET = 110,
    PIPE_CAP_CLIP_HALFZ = 111,
-   PIPE_CAP_VERTEXID_NOBASE,
+   PIPE_CAP_VERTEXID_NOBASE = 112,
+   PIPE_CAP_POLYGON_OFFSET_CLAMP = 113,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)