virgl: respect max_vertex_attrib_stride cap
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 17 Jul 2018 05:43:57 +0000 (15:43 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 17 Jul 2018 05:45:37 +0000 (15:45 +1000)
This is required for OpenGL 4.4 and OpenGL ES 3.1 support.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/virgl/virgl_hw.h
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/drivers/virgl/virgl_winsys.h

index 118249e6950b3e426ed281c2f6dc7d27d9f42955..f501da7cc13cb17dc0c639f2be77e2b699db2417 100644 (file)
@@ -300,7 +300,8 @@ struct virgl_caps_v2 {
         uint32_t uniform_buffer_offset_alignment;
         uint32_t shader_buffer_offset_alignment;
         uint32_t capability_bits;
-       uint32_t msaa_sample_positions[8];
+        uint32_t msaa_sample_positions[8];
+        uint32_t max_vertex_attrib_stride;
 };
 
 union virgl_caps {
index 8bd6673c3c938006d7582913e3bb32264d4e2217..e32d454d19b2e9fcd0345f65239e16f1b1f28a8d 100644 (file)
@@ -219,6 +219,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return vscreen->caps.caps.v2.max_shader_patch_varyings;
    case PIPE_CAP_SAMPLER_VIEW_TARGET:
       return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_TEXTURE_VIEW;
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return vscreen->caps.caps.v2.max_vertex_attrib_stride;
    case PIPE_CAP_TEXTURE_GATHER_SM5:
    case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_FAKE_SW_MSAA:
@@ -226,7 +228,6 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
    case PIPE_CAP_MULTI_DRAW_INDIRECT:
    case PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS:
-   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
    case PIPE_CAP_CLIP_HALFZ:
    case PIPE_CAP_VERTEXID_NOBASE:
    case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
index 99ab4d3840519221125b02953e44f402aa1ad353..6346c21fafcb365e54c48a77e4393f3345027e79 100644 (file)
@@ -136,5 +136,6 @@ static inline void virgl_ws_fill_new_caps_defaults(struct virgl_drm_caps *caps)
    caps->caps.v2.uniform_buffer_offset_alignment = 256;
    caps->caps.v2.shader_buffer_offset_alignment = 32;
    caps->caps.v2.capability_bits = 0;
+   caps->caps.v2.max_vertex_attrib_stride = 0;
 }
 #endif