From 4202cf8bf168229135173bcf67ddc99d74fe7d81 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 16 Sep 2019 14:30:03 +0200 Subject: [PATCH] v3d: expose OES_geometry_shader MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Alejandro Piñeiro --- src/gallium/drivers/v3d/v3d_screen.c | 31 +++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index a3eef791a42..1b0c219cb58 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -251,6 +251,16 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_UMA: return 1; + /* Geometry shaders */ + case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS: + /* Minimum required by GLES 3.2 */ + return 1024; + case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES: + /* MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS / 4 */ + return 256; + case PIPE_CAP_MAX_GS_INVOCATIONS: + return 32; + default: return u_pipe_screen_get_param_defaults(pscreen, param); } @@ -297,6 +307,10 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, if (!screen->has_csd) return 0; break; + case PIPE_SHADER_GEOMETRY: + if (screen->devinfo.ver < 41) + return 0; + break; default: return 0; } @@ -313,10 +327,16 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, return UINT_MAX; case PIPE_SHADER_CAP_MAX_INPUTS: - if (shader == PIPE_SHADER_FRAGMENT) - return V3D_MAX_FS_INPUTS / 4; - else + switch (shader) { + case PIPE_SHADER_VERTEX: return V3D_MAX_VS_INPUTS / 4; + case PIPE_SHADER_GEOMETRY: + return V3D_MAX_GS_INPUTS / 4; + case PIPE_SHADER_FRAGMENT: + return V3D_MAX_FS_INPUTS / 4; + default: + return 0; + }; case PIPE_SHADER_CAP_MAX_OUTPUTS: if (shader == PIPE_SHADER_FRAGMENT) return 4; @@ -361,9 +381,10 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS: if (screen->has_cache_flush) { - if (shader == PIPE_SHADER_VERTEX) + if (shader == PIPE_SHADER_VERTEX || + shader == PIPE_SHADER_GEOMETRY) { return 0; - + } return PIPE_MAX_SHADER_BUFFERS; } else { return 0; -- 2.30.2