v3d: expose OES_geometry_shader
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 16 Sep 2019 12:30:03 +0000 (14:30 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 16 Dec 2019 07:42:37 +0000 (08:42 +0100)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/gallium/drivers/v3d/v3d_screen.c

index a3eef791a42a86c02f4f317f074bdde49e92a946..1b0c219cb588d21991443616a10862b66f057f29 100644 (file)
@@ -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;