vrend,caps: Add a caps feature check version

When we add new feature checks on the host side that is used to enable
a cap conditionally in the guest that was enabled unconditionally before
we might end up with a feature regression when a new mesa version is
used with an old virglrenderer version that doesn't check for that cap.

To work around this problem add a version id to the caps that corresponds
to the features that are actually checked on the host so that it can be
checked in the guest whether this cap was actually checked for or whether
it should be enabled unconditionally.

The id should be incremented whenever a new feature check is added that
might result in a feature regression in the guest when run on an old host.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Pohsien Wang <pwang@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Gert Wollny 6 years ago committed by Dave Airlie
parent 94b282b994
commit 660a02af5a
  1. 1
      src/virgl_hw.h
  2. 6
      src/vrend_renderer.c

@ -367,6 +367,7 @@ struct virgl_caps_v2 {
uint32_t max_atomic_counter_buffers[6];
uint32_t max_combined_atomic_counters;
uint32_t max_combined_atomic_counter_buffers;
uint32_t host_feature_check_version;
};
union virgl_caps {

@ -8508,6 +8508,12 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver, union virgl_c
GLint max;
GLfloat range[2];
/* Count this up when you add a feature flag that is used to set a CAP in
* the guest that was set unconditionally before. Then check that flag and
* this value to avoid regressions when a guest with a new mesa version is
* run on an old virgl host */
caps->v2.host_feature_check_version = 1;
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, range);
caps->v2.min_aliased_point_size = range[0];
caps->v2.max_aliased_point_size = range[1];

Loading…
Cancel
Save