[virglrenderer-devel] [PATCH] check before calling multisample
Po-Hsien Wang
pwang at chromium.org
Wed Jul 18 22:18:27 UTC 2018
Based on the website, glTexStorage2DMultisample requires at least
opengles >= 31 and opengl >= 43 or the extension.
Adding the check here.
---
src/vrend_renderer.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 69f1da3..0938169 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -7355,7 +7355,8 @@ static void vrend_renderer_fill_caps_gles(uint32_t set, UNUSED uint32_t version,
/* Not available on GLES */
caps->v2.texture_buffer_offset_alignment = 0;
- caps->v1.max_samples = vrend_renderer_query_multisample_caps(max, &caps->v2);
+ if (gles_ver >= 31)
+ caps->v1.max_samples = vrend_renderer_query_multisample_caps(max, &caps->v2);
}
void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
@@ -7582,7 +7583,9 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, (GLint*)&caps->v2.shader_buffer_offset_alignment);
}
- caps->v1.max_samples = vrend_renderer_query_multisample_caps(max, &caps->v2);
+ if (gl_ver >= 43 || epoxy_has_gl_extension("GL_ARB_texture_storage_multisample")){
+ caps->v1.max_samples = vrend_renderer_query_multisample_caps(max, &caps->v2);
+ }
caps->v2.capability_bits |= VIRGL_CAP_TGSI_INVARIANT | VIRGL_CAP_SET_MIN_SAMPLES;
--
2.18.0.233.g985f88cf7e-goog
More information about the virglrenderer-devel
mailing list