From: Ilia Mirkin Date: Mon, 6 Apr 2020 03:43:08 +0000 (-0400) Subject: gallium: add viewport swizzling state and cap X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4137a79c2a7edb5f0caf0964ab748da7c279b61c;p=mesa.git gallium: add viewport swizzling state and cap Signed-off-by: Ilia Mirkin Reviewed-by: Marek Olšák Part-of: --- diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index d770a84c21a..c6795ac260e 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -258,6 +258,7 @@ 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_VIEWPORT_SWIZZLE: case PIPE_CAP_MIXED_COLOR_DEPTH_BITS: case PIPE_CAP_TGSI_ARRAY_COMPONENTS: case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS: diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 4743f0ffdff..520563a6a33 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -573,6 +573,7 @@ The integer capabilities: * ``PIPE_CAP_PSIZ_CLAMPED``: Driver needs for the point size to be clamped. Additionally, the gl_PointSize has been modified and its value should be lowered for transform feedback, if needed. Defaults to false. * ``PIPE_CAP_DRAW_INFO_START_WITH_USER_INDICES``: pipe_draw_info::start can be non-zero with user indices. * ``PIPE_CAP_GL_BEGIN_END_BUFFER_SIZE``: Buffer size used to upload vertices for glBegin/glEnd. +* ``PIPE_CAP_VIEWPORT_SWIZZLE``: Whether pipe_viewport_state::swizzle can be used to specify pre-clipping swizzling of coordinates (see GL_NV_viewport_swizzle). .. _pipe_capf: diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 04388d317a3..5fb6fcf3ebd 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -626,6 +626,20 @@ enum pipe_swizzle { PIPE_SWIZZLE_MAX, /**< Number of enums counter (must be last) */ }; +/** + * Viewport swizzles + */ +enum pipe_viewport_swizzle { + PIPE_VIEWPORT_SWIZZLE_POSITIVE_X, + PIPE_VIEWPORT_SWIZZLE_NEGATIVE_X, + PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y, + PIPE_VIEWPORT_SWIZZLE_NEGATIVE_Y, + PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z, + PIPE_VIEWPORT_SWIZZLE_NEGATIVE_Z, + PIPE_VIEWPORT_SWIZZLE_POSITIVE_W, + PIPE_VIEWPORT_SWIZZLE_NEGATIVE_W, +}; + #define PIPE_TIMEOUT_INFINITE 0xffffffffffffffffull @@ -920,6 +934,7 @@ enum pipe_cap PIPE_CAP_PSIZ_CLAMPED, PIPE_CAP_DRAW_INFO_START_WITH_USER_INDICES, PIPE_CAP_GL_BEGIN_END_BUFFER_SIZE, + PIPE_CAP_VIEWPORT_SWIZZLE, }; /** diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index b0d8eaed2fa..736649acd2f 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -213,6 +213,10 @@ struct pipe_viewport_state { float scale[3]; float translate[3]; + enum pipe_viewport_swizzle swizzle_x:3; + enum pipe_viewport_swizzle swizzle_y:3; + enum pipe_viewport_swizzle swizzle_z:3; + enum pipe_viewport_swizzle swizzle_w:3; };