Hi all,
We are using in our Qt app the Qt distribution of ANGLE (ANGLE 2.1.30d6c255d238).
glGetString(GL_EXTENSIONS) is returning the follwing string:
GL_OES_element_index_uint GL_OES_packed_depth_stencil GL_OES_get_program_binary GL_OES_rgb8_rgba8 GL_EXT_texture_format_BGRA8888 GL_EXT_read_format_bgra GL_NV_pixel_buffer_object GL_OES_mapbuffer GL_EXT_map_buffer_range GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_float GL_OES_texture_float_linear GL_EXT_texture_rg GL_EXT_texture_compression_dxt1 GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_sRGB GL_ANGLE_depth_texture GL_EXT_texture_storage GL_OES_texture_npot GL_EXT_draw_buffers GL_EXT_texture_filter_anisotropic GL_EXT_occlusion_query_boolean GL_NV_fence GL_EXT_robustness GL_EXT_blend_minmax GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_pack_reverse_row_order GL_OES_standard_derivatives GL_EXT_shader_texture_lod GL_EXT_frag_depth GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source
As you can see, GL_ANGLE_framebuffer_multisample is there. So, in our code, after checking that the extension is present, we get the proc address of the gl function "glRenderbufferStorageMultisampleANGLE", with:
glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC)eglGetProcAddress("glRenderbufferStorageMultisampleANGLE");
The result is a not null function pointer, so we assume that it is correct. However, when we configure our multisample buffer, we are getting OpenGL errors. The buffer initialization code is like this:
glGenRenderbuffers(1, &ColorBuffer);
glBindRenderbuffer(GL_RENDERBUFFER, ColorBuffer);
glRenderbufferStorageMultisample(GL_RENDERBUFFER, NumSamples, GL_RGBA8, viewport.width, viewport.height);
glGenRenderbuffers(1, &DepthStencilBuffer);
glBindRenderbuffer(GL_RENDERBUFFER, DepthStencilBuffer);
glRenderbufferStorageMultisample(GL_RENDERBUFFER, NumSamples, GL_DEPTH24_STENCIL8, viewport.width, viewport.height);
glGenFramebuffers(1, &FrameBuffer);
glBindFramebuffer(GL_FRAMEBUFFER, FrameBuffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, ColorBuffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, DepthStencilBuffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, DepthStencilBuffer);
The above code, that was perfectly working on iOS (OpenGL ES 2) and Mac OSX (OpenGL 3), fails to work on OpenGL ES 2.0 (ANGLE) on certain machines. After the first call to glRenderbufferStorageMultisample, we check for GL errors and get GL_INVALID_VALUE. The number of samples passed is 4.
Also, surprisingly, the following sentence tells us that the max samples supported are 0:
int maxSamples = 0;
glGetIntegerv(GL_MAX_SAMPLES_ANGLE, &maxSamples);
Any ideas on what could be happening?
Thanks in advance,
Robert.