check before calling multisample

Based on the website, glTexStorage2DMultisample requires at least
opengles >= 31 and opengl >= 43 or the extension.
Adding the check here.

v2: rebased using the features.
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Po-Hsien Wang 6 years ago committed by Dave Airlie
parent bef8c7ebf9
commit 8c155eca46
  1. 5
      src/vrend_renderer.c

@ -125,6 +125,7 @@ enum features_id
feat_ssbo,
feat_ssbo_barrier,
feat_stencil_texturing,
feat_storage_multisample,
feat_tessellation,
feat_texture_array,
feat_texture_buffer_range,
@ -187,6 +188,7 @@ static const struct {
[feat_ssbo] = { 43, 31, { "GL_ARB_shader_storage_buffer_object" } },
[feat_ssbo_barrier] = { 43, 31, {} },
[feat_stencil_texturing] = { 43, 31, { "GL_ARB_stencil_texturing" } },
[feat_storage_multisample] = { 43, 31, { "GL_ARB_texture_storage_multisample" } },
[feat_tessellation] = { 40, UNAVAIL, { "GL_ARB_tessellation_shader" } },
[feat_texture_array] = { 30, 30, { "GL_EXT_texture_array" } },
[feat_texture_buffer_range] = { 43, UNAVAIL, { "GL_ARB_texture_buffer_range" } },
@ -8117,7 +8119,8 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver, union virgl_c
glGetIntegerv(GL_MAX_IMAGE_SAMPLES, (GLint*)&caps->v2.max_image_samples);
}
caps->v1.max_samples = vrend_renderer_query_multisample_caps(caps->v1.max_samples, &caps->v2);
if (has_feature(feat_storage_multisample))
caps->v1.max_samples = vrend_renderer_query_multisample_caps(caps->v1.max_samples, &caps->v2);
caps->v2.capability_bits |= VIRGL_CAP_TGSI_INVARIANT | VIRGL_CAP_SET_MIN_SAMPLES | VIRGL_CAP_TGSI_PRECISE;

Loading…
Cancel
Save