<div dir="ltr">This works for me locally. But I would like to generate the caps using only one code path for easier maintenance. IIUC, currently have_* and fill_caps are doing the similar things.<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 18, 2018 at 4:15 PM David Riley <<a href="mailto:davidriley@chromium.org">davidriley@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Currently based on have_multisample, but glSampleMaski isn't supported<br>
with the same versions.<br>
<br>
Signed-off-by: David Riley <<a href="mailto:davidriley@chromium.org" target="_blank">davidriley@chromium.org</a>><br>
---<br>
src/vrend_renderer.c | 17 ++++++++++++-----<br>
1 file changed, 12 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c<br>
index 69f1da3..e358b65 100644<br>
--- a/src/vrend_renderer.c<br>
+++ b/src/vrend_renderer.c<br>
@@ -107,6 +107,7 @@ struct global_renderer_state {<br>
bool have_arb_or_gles_ext_texture_buffer;<br>
bool have_multisample;<br>
bool have_ms_scaled_blit;<br>
+ bool have_sample_mask;<br>
bool have_nv_prim_restart;<br>
bool have_gl_prim_restart;<br>
bool have_bit_encoding;<br>
@@ -4068,10 +4069,12 @@ static void vrend_hw_emit_rs(struct vrend_context *ctx)<br>
}<br>
<br>
if (vrend_state.have_multisample) {<br>
- if (state->multisample)<br>
- glEnable(GL_SAMPLE_MASK);<br>
- else<br>
- glDisable(GL_SAMPLE_MASK);<br>
+ if (vrend_state.have_sample_mask) {<br>
+ if (state->multisample)<br>
+ glEnable(GL_SAMPLE_MASK);<br>
+ else<br>
+ glDisable(GL_SAMPLE_MASK);<br>
+ }<br>
<br>
/* GLES doesn't have GL_MULTISAMPLE */<br>
if (!vrend_state.use_gles) {<br>
@@ -4537,6 +4540,9 @@ int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)<br>
if (epoxy_has_gl_extension("GL_EXT_framebuffer_multisample_blit_scaled"))<br>
vrend_state.have_ms_scaled_blit = true;<br>
}<br>
+ if (gl_ver >= 32 || (gles && gl_ver >= 31) ||<br>
+ epoxy_has_gl_extension("GL_ARB_texture_multisample"))<br>
+ vrend_state.have_sample_mask = true;<br>
<br>
if (gl_ver >= 40 || epoxy_has_gl_extension("GL_ARB_sample_shading"))<br>
vrend_state.have_sample_shading = true;<br>
@@ -6105,7 +6111,8 @@ void vrend_set_clip_state(struct vrend_context *ctx, struct pipe_clip_state *ucp<br>
<br>
void vrend_set_sample_mask(UNUSED struct vrend_context *ctx, unsigned sample_mask)<br>
{<br>
- glSampleMaski(0, sample_mask);<br>
+ if (vrend_state.have_sample_mask)<br>
+ glSampleMaski(0, sample_mask);<br>
}<br>
<br>
void vrend_set_min_samples(struct vrend_context *ctx, unsigned min_samples)<br>
-- <br>
2.18.0.203.gfac676dfb9-goog<br>
<br>
</blockquote></div></div>