From 7e40c41e69b8c9a66467180b416cb46364963629 Mon Sep 17 00:00:00 2001 From: chenjiangnan Date: Thu, 13 May 2021 08:49:29 +0800 Subject: [PATCH] vrend: According to the OpenGL ES 3.1 specification section 9.2.1, the GL_FRAMEBUFFER_DEFAULT_LAYERS parameter name is not supported. Signed-off-by: chenjiangnan Reviewed-by: Gert Wollny --- 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 022ebdd..d2e546a 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -2614,13 +2614,16 @@ void vrend_set_framebuffer_state_no_attach(UNUSED struct vrend_context *ctx, uint32_t width, uint32_t height, uint32_t layers, uint32_t samples) { + int gl_ver = vrend_state.gl_major_ver * 10 + vrend_state.gl_minor_ver; + if (has_feature(feat_fb_no_attach)) { glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_WIDTH, width); glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_HEIGHT, height); - glFramebufferParameteri(GL_FRAMEBUFFER, - GL_FRAMEBUFFER_DEFAULT_LAYERS, layers); + if (!(vrend_state.use_gles && gl_ver <= 31)) + glFramebufferParameteri(GL_FRAMEBUFFER, + GL_FRAMEBUFFER_DEFAULT_LAYERS, layers); glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_SAMPLES, samples); }