gallium: add PIPE_CAP_RASTERIZER_SUBPIXEL_BITS
authorMarek Olšák <marek.olsak@amd.com>
Thu, 6 Sep 2018 04:09:27 +0000 (00:09 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 6 Sep 2018 20:07:40 +0000 (16:07 -0400)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/util/u_screen.c
src/gallium/docs/source/screen.rst
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_get.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index c41e28820b21f199edef5298a90d90fa96804642..f0290d04cc559f714abb565e38ca33db462e74bf 100644 (file)
@@ -254,6 +254,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
    case PIPE_CAP_NATIVE_FENCE_FD:
       return 0;
 
+   case PIPE_CAP_RASTERIZER_SUBPIXEL_BITS:
+      return 4; /* GLES 2.0 minimum value */
+
    case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 1;
 
index 93415a5df1a875df23eefe99e520f4d5e9281220..cb9d0e2a15a305c982d82f00994a1ee473c679c5 100644 (file)
@@ -342,6 +342,8 @@ The integer capabilities:
   for ``pipe_rasterizer_state::offset_units_unscaled``.
 * ``PIPE_CAP_VIEWPORT_SUBPIXEL_BITS``: Number of bits of subpixel precision for
   floating point viewport bounds.
+* ``PIPE_CAP_RASTERIZER_SUBPIXEL_BITS``: Number of bits of subpixel precision used
+  by the rasterizer.
 * ``PIPE_CAP_MIXED_COLOR_DEPTH_BITS``: Whether there is non-fallback
   support for color/depth format combinations that use a different
   number of bits. For the purpose of this cap, Z24 is treated as
index e10704bfc17ba6498277a716377e8b4cd2814001..c6311bf8c39fdaa2589bf1544e356f4a2ec93361 100644 (file)
@@ -507,6 +507,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_VIEWPORTS:
                return R600_MAX_VIEWPORTS;
        case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+       case PIPE_CAP_RASTERIZER_SUBPIXEL_BITS:
                return 8;
 
        /* Timer queries, present when the clock frequency is non zero. */
index d373c1a967dc2bea37145eead43d392a966cd28a..60f4b07113f391aef0f2218c2a61bae1236e7183 100644 (file)
@@ -286,6 +286,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_VIEWPORTS:
                return SI_MAX_VIEWPORTS;
        case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+       case PIPE_CAP_RASTERIZER_SUBPIXEL_BITS:
        case PIPE_CAP_MAX_RENDER_TARGETS:
                return 8;
        case PIPE_CAP_FRAMEBUFFER_MSAA_CONSTRAINTS:
index bdd3f4680f61554a2b03d298bed08e3ad636c09d..3cff4d9fda5a043a05f4fe492793b1383d938577 100644 (file)
@@ -774,6 +774,7 @@ enum pipe_cap
    PIPE_CAP_MAX_WINDOW_RECTANGLES,
    PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED,
    PIPE_CAP_VIEWPORT_SUBPIXEL_BITS,
+   PIPE_CAP_RASTERIZER_SUBPIXEL_BITS,
    PIPE_CAP_MIXED_COLOR_DEPTH_BITS,
    PIPE_CAP_TGSI_ARRAY_COMPONENTS,
    PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS,
index 244c12595ec6ca64050b05ae26b7f99e3002b8f7..319eef6a729066441b158aedd567dd8c8815e170 100644 (file)
@@ -111,6 +111,7 @@ void st_init_limits(struct pipe_screen *screen,
    c->MaxRenderbufferSize = c->MaxTextureRectSize;
 
    c->SubPixelBits =
+      screen->get_param(screen, PIPE_CAP_RASTERIZER_SUBPIXEL_BITS);
    c->ViewportSubpixelBits =
       screen->get_param(screen, PIPE_CAP_VIEWPORT_SUBPIXEL_BITS);