Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on huawei mate20X #1587

Closed
geroge-d opened this issue Sep 3, 2019 · 10 comments
Closed

crash on huawei mate20X #1587

geroge-d opened this issue Sep 3, 2019 · 10 comments
Assignees
Labels
android Issue/feature request for Android only bug Something isn't working gpu specific This bug occurs only with a single GPU vendor. opengl Issue/request specific to OpenGL

Comments

@geroge-d
Copy link

geroge-d commented Sep 3, 2019

Describe the bug
09-03 16:35:23.415 14980 15250 E Filament: OpenGL error 0x500 (GL_INVALID_ENUM) in "GLuint filament::OpenGLDriver::getSamplerSlow(filament::backend::SamplerParams) const" at line 2737

FYI
we use external texture

Screenshots
123

Desktop (please complete the following information):

  • OS:android 9.0
  • GPU: Mali-G76
  • Backend:OpenGL ES 3.2 v1.r14p0-00cet0.83aa61925da293fcf06a8af4caf09ce9

Smartphone (please complete the following information):

  • Device: huawei mate 20 X
  • OS: android 9.0

Additional context
1

extension list:
gles extensions:GL_EXT_debug_marker GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_EXT_texture_compression_astc_decode_mode GL_EXT_texture_compression_astc_decode_mode_rgb9e5 GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_extension_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL_OES_copy_image GL_EXT_shader_non_constant_global_initializers GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex GL_EXT_protected_textures GL_EXT_buffer_storage

@geroge-d
Copy link
Author

geroge-d commented Sep 3, 2019

stacktrace:

#00 pc 000000000002282c /system/lib64/libc.so (abort+116) [arm64-v8a]

#1 pc 0000000000393cf4 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so [arm64-v8a]
#2 pc 0000000000393d74 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so [arm64-v8a]
#3 pc 0000000000390e88 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so [arm64-v8a]
#4 pc 0000000000390e30 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (std::terminate()+52) [arm64-v8a]
#5 pc 0000000000314180 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::GLUtils::checkGLError(utils::io::ostream&, char const*, unsigned long)+512) [arm64-v8a]
#6 pc 00000000002de558 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::OpenGLDriver::getSamplerSlow(filament::backend::SamplerParams) const+936) [arm64-v8a]
#7 pc 000000000030890c /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::OpenGLDriver::getSampler(filament::backend::SamplerParams) const+204) [arm64-v8a]
#8 pc 0000000000308328 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::OpenGLProgram::updateSamplers(filament::OpenGLDriver*)+584) [arm64-v8a]
10 #9 pc 00000000002fc064 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::OpenGLProgram::use(filament::OpenGLDriver*)+84) [arm64-v8a]
11 #10 pc 00000000002fbf78 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::OpenGLDriver::useProgram(filament::OpenGLProgram*)+56) [arm64-v8a]
12 #11 pc 00000000002ebd70 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::OpenGLDriver::draw(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive)+128) [arm64-v8a]
13 #12 pc 0000000000307574 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (void filament::backend::trampoline<void (filament::OpenGLDriver::)(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive), filament::OpenGLDriver&, std::__ndk1::tuple<filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive >&, 0ul, 1ul>(void (filament::OpenGLDriver::&&)(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive), filament::OpenGLDriver&&&, std::__ndk1::tuple<filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive >&&&, std::__ndk1::integer_sequence<unsigned long, 0ul, 1ul>)+228) [arm64-v8a]
14 #13 pc 0000000000307454 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (void filament::backend::apply<void (filament::OpenGLDriver::)(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive), filament::OpenGLDriver&, std::__ndk1::tuple<filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive >&>(void (filament::OpenGLDriver::&&)(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive), filament::OpenGLDriver&&&, std::__ndk1::tuple<filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive >&&&)+100) [arm64-v8a]
15 #14 pc 00000000002ebcd0 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (void filament::backend::CommandType<void (filament::backend::Driver::)(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive)>::Command<&(filament::backend::Driver::draw(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive))>::execute<void (filament::OpenGLDriver::)(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive), filament::OpenGLDriver&>(void (filament::OpenGLDriver::&&)(filament::backend::PipelineState, filament::backend::Handlefilament::backend::HwRenderPrimitive), filament::OpenGLDriver&&&, filament::backend::CommandBase, long*)+128) [arm64-v8a]
16 #15 pc 00000000002e43d4 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::backend::ConcreteDispatcherfilament::OpenGLDriver::draw(filament::backend::Driver&, filament::backend::CommandBase*, long*)+68) [arm64-v8a]
17 #16 pc 00000000002cb140 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::backend::CommandBase::execute(filament::backend::Driver&)+64) [arm64-v8a]
18 #17 pc 00000000002cad78 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::backend::CommandStream::execute(void*)+152) [arm64-v8a]
19 #18 pc 00000000001e1ad0 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::details::FEngine::execute()+288) [arm64-v8a]
20 #19 pc 00000000001df724 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so (filament::details::FEngine::loop()+692) [arm64-v8a]
21 #20 pc 00000000001f7a70 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so [arm64-v8a]
22 #21 pc 00000000001f7938 /data/app/com.kaiqi.videoae-fRrA7dhrFzuXVl1hgTXw5g==/lib/arm64/libfilament-jni.so [arm64-v8a]
23 java:

@romainguy romainguy added android Issue/feature request for Android only bug Something isn't working gpu specific This bug occurs only with a single GPU vendor. opengl Issue/request specific to OpenGL labels Sep 3, 2019
@romainguy
Copy link
Collaborator

The only thing that could trigger this error in getSamplerSlow() is:

    if (ext.texture_filter_anisotropic) {
        GLfloat anisotropy = float(1 << params.anisotropyLog2);
        glSamplerParameterf(s, GL_TEXTURE_MAX_ANISOTROPY_EXT, std::min(mMaxAnisotropy, anisotropy));
    }

This GPU doesn't have the extension GL_EXT_texture_filter_anisotropic so the test should always fail. Could you check if removing the call to glSamplerParameterf() inside the if statement fixes the issue please?

@geroge-d
Copy link
Author

geroge-d commented Sep 4, 2019

Ok, i'll test it later and update you

@geroge-d
Copy link
Author

geroge-d commented Sep 5, 2019

yes it is caused by texture_filter_anisotropic been set to true. But I don't know where this value is set. because the device don't has this extension GL_EXT_texture_filter_anisotropic .

@geroge-d
Copy link
Author

geroge-d commented Sep 5, 2019

I add some codes to reproduce this isuse, please see the code below
1
This picture show the output of this code
2

@geroge-d
Copy link
Author

geroge-d commented Sep 5, 2019

the code below is the only place where i find in filament to set value of texture_filter_anisotropic for opengles backend . Please tell me if i miss something
3

@romainguy
Copy link
Collaborator

It is the only place where we set it.

@kaelsass
Copy link

kaelsass commented Nov 4, 2019

We met the same problem on Huawei P30. It supports GL_EXT_texture_filter_anisotropic extension, but it seems that GL_TEXTURE_MAX_ANISOTROPY_EXT value can't be recognized. glSamplerParameterf(s, GL_TEXTURE_MAX_ANISOTROPY_EXT, std::min(gl.gets.maxAnisotropy, anisotropy)); will generate error OpenGL error 0x500 (GL_INVALID_ENUM)

Filament Version: 1.4.1

@romainguy
Copy link
Collaborator

@pixelflinger @prideout We should disable anisotropy support on Mali-Gxx GPUs apparently.

@romainguy
Copy link
Collaborator

Please try with more recent versions of Filament

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Issue/feature request for Android only bug Something isn't working gpu specific This bug occurs only with a single GPU vendor. opengl Issue/request specific to OpenGL
Projects
None yet
Development

No branches or pull requests

5 participants