From 35232330274cff321e746b219db9ec9de23172d0 Mon Sep 17 00:00:00 2001 From: Andreas Baierl Date: Tue, 4 Jun 2019 13:25:28 +0200 Subject: [PATCH] gallium: Add PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL This adds an option to treat gl_PointCoord as a system value. Signed-off-by: Andreas Baierl Reviewed-by: Qiang Yu Reviewed-by: Eric Anholt --- src/gallium/auxiliary/util/u_screen.c | 1 + src/gallium/docs/source/screen.rst | 2 ++ src/gallium/include/pipe/p_defines.h | 1 + src/mesa/state_tracker/st_extensions.c | 2 ++ 4 files changed, 6 insertions(+) diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index 2736deb..810ba8d 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -227,6 +227,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen, case PIPE_CAP_MULTI_DRAW_INDIRECT: case PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS: case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL: + case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL: case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL: return 0; diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index b993087..ba7a9d4 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -303,6 +303,8 @@ The integer capabilities: TGSI opcodes are supported. * ``PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL``: If state trackers should use a system value for the POSITION fragment shader input. +* ``PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL``: If state trackers should use + a system value for the POINT fragment shader input. * ``PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL``: If state trackers should use a system value for the FACE fragment shader input. Also, the FACE system value is integer, not float. diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index d6e33ce..0271a08 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -798,6 +798,7 @@ enum pipe_cap PIPE_CAP_MULTI_DRAW_INDIRECT, PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS, PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL, + PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL, PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL, PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT, PIPE_CAP_INVALIDATE_BUFFER, diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 3b77108..867ec49 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -444,6 +444,8 @@ void st_init_limits(struct pipe_screen *screen, c->GLSLFragCoordIsSysVal = screen->get_param(screen, PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL); + c->GLSLPointCoordIsSysVal = + screen->get_param(screen, PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL); c->GLSLFrontFacingIsSysVal = screen->get_param(screen, PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL); -- 2.7.4