DiligentGraphics / DiligentSamples

Sample projects demonstrating the usage of Diligent Engine
http://diligentgraphics.com/diligent-engine/samples/
Apache License 2.0
320 stars 80 forks source link

HelloAR sample Pixel 6 crash on launch #108

Closed speedym closed 10 months ago

speedym commented 1 year ago

I have encountered the following Debug build crash on launch:

tgkill 0x000000708ed37f38 Diligent::AndroidDebug::AssertionFailed(const char , const char , const char , int) AndroidDebug.cpp:42 Diligent::DebugAssertionFailed(const char , const char , const char , int) AndroidDebug.cpp:77 Diligent::InternalTexFormatToTexFormatMap::operator[](unsigned int) const GLTypeConversions.cpp:253 Diligent::GLInternalTexFormatToTexFormat(unsigned int) GLTypeConversions.cpp:267 Diligent::GetTextureDescFromGLHandle(Diligent::GLContextState &, Diligent::TextureDesc, unsigned int, unsigned int) TextureBaseGL.cpp:252 Diligent::TextureBaseGL::TextureBaseGL(Diligent::IReferenceCounters , Diligent::FixedBlockMemoryAllocator &, Diligent::RenderDeviceGLImpl , Diligent::GLContextState &, const Diligent::TextureDesc &, unsigned int, unsigned int, bool) TextureBaseGL.cpp:310 Diligent::Texture2D_GL::Texture2D_GL(Diligent::IReferenceCounters , Diligent::FixedBlockMemoryAllocator &, Diligent::RenderDeviceGLImpl , Diligent::GLContextState &, const Diligent::TextureDesc &, unsigned int, unsigned int, bool) Texture2D_GL.cpp:141 Diligent::MakeNewRCObj::operator()<…>(Diligent::FixedBlockMemoryAllocator &, Diligent::RenderDeviceGLImpl &&, Diligent::GLContextState &, const Diligent::TextureDesc &, unsigned int &, unsigned int &) RefCountedObjectImpl.hpp:670 $_1::operator()() const RenderDeviceGLImpl.cpp:404 Diligent::RenderDeviceBase::CreateDeviceObject<…>(const char , const Diligent::TextureDesc &, Diligent::ITexture , $_1) RenderDeviceBase.hpp:495 Diligent::RenderDeviceGLImpl::CreateTextureFromGLHandle(unsigned int, unsigned int, const Diligent::TextureDesc &, Diligent::RESOURCE_STATE, Diligent::ITexture ) RenderDeviceGLImpl.cpp:384 hello_ar::BackgroundRenderer::Initialize(Diligent::IRenderDevice ) BackgroundRenderer.cc:109 hello_ar::HelloArApplication::OnSurfaceCreated() hello_ar_application.cc:135 Java_com_google_ar_core_examples_c_helloar_JniInterface_onGlSurfaceCreated(JNIEnv , jclass, jlong) jni_interface.cc:72 art_quick_generic_jni_trampoline 0x0000006df6e22248 art_quick_invoke_static_stub 0x0000006df6e18bec art::ArtMethod::Invoke(art::Thread , unsigned int , unsigned int, art::JValue , const char ) 0x0000006df6e84228 art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread , art::ArtMethod , art::ShadowFrame , unsigned short, art::JValue ) 0x0000006df6fe34b0 art::interpreter::DoCall<…>(art::ArtMethod , art::Thread , art::ShadowFrame &, const art::Instruction , unsigned short, art::JValue ) 0x0000006df6fde324 art::interpreter::ExecuteSwitchImplCpp<…>(art::interpreter::SwitchImplContext ) 0x0000006df6e2c9b0 ExecuteSwitchImplAsm 0x0000006df6e24bdc art::interpreter::ExecuteSwitch(art::Thread , const art::CodeItemDataAccessor &, art::ShadowFrame &, art::JValue, bool) 0x0000006df6fddd04 art::interpreter::Execute(art::Thread *, const art::CodeItemDataAccessor &, art::ShadowFrame &, art::JValue, bool, bool) 0x0000006df6fd60fc artQuickToInterpreterBridge 0x0000006df733b6bc art_quick_to_interpreter_bridge 0x0000006df6e2237c nterp_helper 0x0000006df6e139c0 nterp_helper 0x0000006df6e124c8

, with the following log:

2022-09-27 13:06:29.421 20843-20938/com.google.ar.core.examples.c.helloar I/hello_ar_example_c: OnSurfaceCreated() 2022-09-27 13:06:29.422 20843-20938/com.google.ar.core.examples.c.helloar I/Diligent Engine: Diligent Engine: Info: User-defined allocator is not provided. Using default allocator. 2022-09-27 13:06:29.426 20843-20938/com.google.ar.core.examples.c.helloar I/Diligent Engine: Diligent Engine: Info: GPU Vendor: arm 2022-09-27 13:06:29.426 20843-20938/com.google.ar.core.examples.c.helloar E/libEGL: called unimplemented OpenGL ES API 2022-09-27 13:06:29.426 20843-20938/com.google.ar.core.examples.c.helloar I/Diligent Engine: Diligent Engine: Info: Supported 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 G 2022-09-27 13:06:29.427 20843-20938/com.google.ar.core.examples.c.helloar I/Diligent Engine: _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_EXT_multisampled_render_to_texture2 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_primi 2022-09-27 13:06:29.427 20843-20938/com.google.ar.core.examples.c.helloar I/Diligent Engine: ive_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_unpack_subimage GL_EXT_color_buffer_float GL_EXT_float_blend 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 GL_EXT_external_buffer GL_EXT_EGL_image_array GL_EXT_texture_filter_anisotropic GL_OES_texture_float_linear GL_ARM_texture_unnormalized_coordinates GL_EXT_shader_framebuffer_fetch GL_EXT_clip_control 2022-09-27 13:06:29.427 20843-20938/com.google.ar.core.examples.c.helloar I/Diligent Engine: Diligent Engine: Info: Disabling separable shader programs 2022-09-27 13:06:29.430 20843-20938/com.google.ar.core.examples.c.helloar W/Diligent Engine: Diligent Engine: Warning: The format (TEX_FORMAT_RGBA8_UNORM) of texture 'External camera texture' specified by TextureDesc struct does not match GL texture internal format (6408) 2022-09-27 13:06:29.430 20843-20938/com.google.ar.core.examples.c.helloar E/Diligent Engine: Diligent Engine: ERROR: Debug assertion failed in operator[](), file GLTypeConversions.cpp, line 253: Unknown GL format

speedym commented 1 year ago

Note: Sample works fine on Pixel 5 (Qualcomm).

TheMostDiligent commented 1 year ago

Hmm, maybe there is some mismatch between RGBA8 vs BGRA8 formats

TheMostDiligent commented 10 months ago

Fixed in https://github.com/DiligentGraphics/DiligentCore/commit/6dc0dc0ed6548022552adeea1fb12f7b9ece468d