<div dir="ltr">Thanks. Rebased. PTAL.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 6, 2018 at 11:13 AM Po-Hsien Wang <<a href="mailto:pwang@chromium.org">pwang@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Based on the website, glTexStorage2DMultisample requires at least<br>
opengles >= 31 and opengl >= 43 or the extension.<br>
Adding the check here.<br>
<br>
v2: rebased using the features.<br>
---<br>
 src/vrend_renderer.c | 6 +++++-<br>
 1 file changed, 5 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c<br>
index ddf7f3a..8ce8d18 100644<br>
--- a/src/vrend_renderer.c<br>
+++ b/src/vrend_renderer.c<br>
@@ -125,6 +125,7 @@ enum features_id<br>
    feat_ssbo,<br>
    feat_ssbo_barrier,<br>
    feat_stencil_texturing,<br>
+   feat_storage_multisample,<br>
    feat_tessellation,<br>
    feat_texture_array,<br>
    feat_texture_buffer_range,<br>
@@ -186,6 +187,7 @@ static const  struct {<br>
    [feat_ssbo] = { 43, 31, { "GL_ARB_shader_storage_buffer_object" } },<br>
    [feat_ssbo_barrier] = { 43, 31, {} },<br>
    [feat_stencil_texturing] = { 43, UNAVAIL, { "GL_ARB_stencil_texturing" } },<br>
+   [feat_storage_multisample] = { 43, 31, { "GL_ARB_texture_storage_multisample" } },<br>
    [feat_tessellation] = { 40, UNAVAIL, { "GL_ARB_tessellation_shader" } },<br>
    [feat_texture_array] = { 30, 30, { "GL_EXT_texture_array" } },<br>
    [feat_texture_buffer_range] = { 43, UNAVAIL, { "GL_ARB_texture_buffer_range" } },<br>
@@ -8100,7 +8102,9 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver,  union virgl_c<br>
       glGetIntegerv(GL_MAX_IMAGE_SAMPLES, (GLint*)&caps->v2.max_image_samples);<br>
    }<br>
<br>
-   caps->v1.max_samples = vrend_renderer_query_multisample_caps(max, &caps->v2);<br>
+   if (has_feature(feat_storage_multisample)) {<br>
+      caps->v1.max_samples = vrend_renderer_query_multisample_caps(max, &caps->v2);<br>
+   }<br>
<br>
    caps->v2.capability_bits |= VIRGL_CAP_TGSI_INVARIANT | VIRGL_CAP_SET_MIN_SAMPLES | VIRGL_CAP_TGSI_PRECISE;<br>
<br>
-- <br>
2.18.0.597.ga71716f1ad-goog<br>
<br>
</blockquote></div>