Looks great to me. Thanks!

Reviewed-by: Roland Scheidegger <srol...@vmware.com>

Am 06.09.2018 um 06:10 schrieb Marek Olšák:
> From: Marek Olšák <marek.ol...@amd.com>
> 
> ---
>  src/gallium/auxiliary/util/u_screen.c  | 3 +++
>  src/gallium/docs/source/screen.rst     | 2 ++
>  src/gallium/drivers/r600/r600_pipe.c   | 1 +
>  src/gallium/drivers/radeonsi/si_get.c  | 1 +
>  src/gallium/include/pipe/p_defines.h   | 1 +
>  src/mesa/state_tracker/st_extensions.c | 1 +
>  6 files changed, 9 insertions(+)
> 
> diff --git a/src/gallium/auxiliary/util/u_screen.c 
> b/src/gallium/auxiliary/util/u_screen.c
> index 7efc9c23bc4..a4d62aa06b7 100644
> --- a/src/gallium/auxiliary/util/u_screen.c
> +++ b/src/gallium/auxiliary/util/u_screen.c
> @@ -247,20 +247,23 @@ u_pipe_screen_get_param_defaults(struct pipe_screen 
> *pscreen,
>     case PIPE_CAP_MAX_WINDOW_RECTANGLES: /* Enables EXT_window_rectangles */
>     case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
>     case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
>     case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
>     case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
>     case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
>     case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
>     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;
>  
>     case PIPE_CAP_TGSI_FS_FBFETCH:
>     case PIPE_CAP_TGSI_MUL_ZERO_WINS:
>     case PIPE_CAP_DOUBLES:
>     case PIPE_CAP_INT64:
>     case PIPE_CAP_INT64_DIVMOD:
>     case PIPE_CAP_TGSI_TEX_TXF_LZ:
>     case PIPE_CAP_TGSI_CLOCK:
> diff --git a/src/gallium/docs/source/screen.rst 
> b/src/gallium/docs/source/screen.rst
> index 66b7221c932..c3bf3efc43b 100644
> --- a/src/gallium/docs/source/screen.rst
> +++ b/src/gallium/docs/source/screen.rst
> @@ -335,20 +335,22 @@ The integer capabilities:
>    extension and thus implements proper support for culling planes.
>  * ``PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES``: Whether primitive restart is
>    supported for patch primitives.
>  * ``PIPE_CAP_TGSI_VOTE``: Whether the ``VOTE_*`` ops can be used in shaders.
>  * ``PIPE_CAP_MAX_WINDOW_RECTANGLES``: The maxium number of window rectangles
>    supported in ``set_window_rectangles``.
>  * ``PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED``: If true, the driver implements 
> support
>    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
>    32-bit. If set to off, that means that a B5G6R5 + Z24 or RGBA8 + Z16
>    combination will require a driver fallback, and should not be
>    advertised in the GLX/EGL config list.
>  * ``PIPE_CAP_TGSI_ARRAY_COMPONENTS``: If true, the driver interprets the
>    UsageMask of input and output declarations and allows declaring arrays
>    in overlapping ranges. The components must be a contiguous range, e.g. a
>    UsageMask of  xy or yzw is allowed, but xz or yw isn't. Declarations with
> diff --git a/src/gallium/drivers/r600/r600_pipe.c 
> b/src/gallium/drivers/r600/r600_pipe.c
> index a43381f4e47..979d2ef40c9 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -504,20 +504,21 @@ static int r600_get_param(struct pipe_screen* pscreen, 
> enum pipe_cap param)
>               return 2048;
>  
>       /* Render targets. */
>       case PIPE_CAP_MAX_RENDER_TARGETS:
>               /* XXX some r6xx are buggy and can only do 4 */
>               return 8;
>  
>       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. */
>       case PIPE_CAP_QUERY_TIME_ELAPSED:
>               return rscreen->b.info.clock_crystal_freq != 0;
>       case PIPE_CAP_QUERY_TIMESTAMP:
>               return rscreen->b.info.drm_minor >= 20 &&
>                      rscreen->b.info.clock_crystal_freq != 0;
>  
>       case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
> diff --git a/src/gallium/drivers/radeonsi/si_get.c 
> b/src/gallium/drivers/radeonsi/si_get.c
> index b7d5468e000..db72a003a16 100644
> --- a/src/gallium/drivers/radeonsi/si_get.c
> +++ b/src/gallium/drivers/radeonsi/si_get.c
> @@ -283,20 +283,21 @@ static int si_get_param(struct pipe_screen *pscreen, 
> enum pipe_cap param)
>               /* textures support 8192, but layered rendering supports 2048 */
>               return 12;
>       case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
>               /* textures support 8192, but layered rendering supports 2048 */
>               return 2048;
>  
>       /* Viewports and render targets. */
>       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:
>               return sscreen->info.has_eqaa_surface_allocator ? 2 : 0;
>  
>       case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
>       case PIPE_CAP_MIN_TEXEL_OFFSET:
>               return -32;
>  
>       case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
> diff --git a/src/gallium/include/pipe/p_defines.h 
> b/src/gallium/include/pipe/p_defines.h
> index 64c9eab3c84..dc6b089c2bf 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -767,20 +767,21 @@ enum pipe_cap
>     PIPE_CAP_PCI_DEVICE,
>     PIPE_CAP_PCI_FUNCTION,
>     PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT,
>     PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR,
>     PIPE_CAP_CULL_DISTANCE,
>     PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES,
>     PIPE_CAP_TGSI_VOTE,
>     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,
>     PIPE_CAP_TGSI_CAN_READ_OUTPUTS,
>     PIPE_CAP_NATIVE_FENCE_FD,
>     PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY,
>     PIPE_CAP_TGSI_FS_FBFETCH,
>     PIPE_CAP_TGSI_MUL_ZERO_WINS,
>     PIPE_CAP_DOUBLES,
>     PIPE_CAP_INT64,
> diff --git a/src/mesa/state_tracker/st_extensions.c 
> b/src/mesa/state_tracker/st_extensions.c
> index 244c12595ec..319eef6a729 100644
> --- a/src/mesa/state_tracker/st_extensions.c
> +++ b/src/mesa/state_tracker/st_extensions.c
> @@ -104,20 +104,21 @@ void st_init_limits(struct pipe_screen *screen,
>  
>     /* Define max viewport size and max renderbuffer size in terms of
>      * max texture size (note: max tex RECT size = max tex 2D size).
>      * If this isn't true for some hardware we'll need new PIPE_CAP_ queries.
>      */
>     c->MaxViewportWidth =
>     c->MaxViewportHeight =
>     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);
>  
>     c->MaxDrawBuffers = c->MaxColorAttachments =
>        _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
>               1, MAX_DRAW_BUFFERS);
>  
>     c->MaxDualSourceDrawBuffers =
>        _clamp(screen->get_param(screen,
>                                 PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS),
> 

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to