virgl: define MAX_VERTEX_STREAMS based on availability of TF3
authorGert Wollny <gert.wollny@collabora.com>
Wed, 13 Mar 2019 17:50:52 +0000 (18:50 +0100)
committerGert Wollny <gw.fossdev@gmail.com>
Tue, 2 Apr 2019 11:28:09 +0000 (11:28 +0000)
Since with gles hosts we lie about the GLSL feature level it is better
to set the number of streams based on actual hosts capabilities.

v2: Make use of feature check level to avoid regressions.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/virgl_hw.h
src/gallium/drivers/virgl/virgl_screen.c

index ed88b6cf8d3928e51d2771f4967b6e8af96040fb..7038f3973d9d556677007d62f97515f474ec2423 100644 (file)
@@ -237,6 +237,7 @@ enum virgl_formats {
 #define VIRGL_CAP_TRANSFER             (1 << 17)
 #define VIRGL_CAP_FBO_MIXED_COLOR_FORMATS (1 << 18)
 #define VIRGL_CAP_FAKE_FP64            (1 << 19)
+#define VIRGL_CAP_TRANSFORM_FEEDBACK3  (1 << 23)
 
 /* virgl bind flags - these are compatible with mesa 10.5 gallium.
  * but are fixed, no other should be passed to virgl either.
index 651b73b0eb0b4e19e213cc0f0b685c5b9a5df46d..5dd7f559948c42350719a12f9089344c71d1f267 100644 (file)
@@ -217,7 +217,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_CULL_DISTANCE:
       return vscreen->caps.caps.v1.bset.has_cull;
    case PIPE_CAP_MAX_VERTEX_STREAMS:
-      return vscreen->caps.caps.v1.glsl_level >= 400 ? 4 : 1;
+      return ((vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_TRANSFORM_FEEDBACK3) ||
+              (vscreen->caps.caps.v2.host_feature_check_version < 2)) ? 4 : 1;
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
       return vscreen->caps.caps.v1.bset.conditional_render_inverted;
    case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE: