kvark / blade

Sharp and simple graphics library
MIT License
551 stars 36 forks source link

Windows gles panics with `MissingFeatures(Features(BUFFER_STORAGE | DYNAMIC_ARRAY_SIZE))` #171

Open MolotovCherry opened 2 months ago

MolotovCherry commented 2 months ago

Not entirely sure what the cause could be here.

My graphics card is capable of handling these things though (it's a 3080ti), so not sure why it says this. I have the latest drivers installed, and no other opengl/vulkan games have problems.

I'm happy to help debug this if you give me the detailed steps to do.

glxinfo.txt by wglinfo

blade graphics debug logs ``` [2024-09-03T14:37:47-07:00 DEBUG blade_graphics::hal::platform] Client extensions: [ "EGL_EXT_client_extensions", "EGL_EXT_device_query", "EGL_EXT_platform_base", "EGL_EXT_platform_device", "EGL_ANGLE_platform_angle", "EGL_ANGLE_platform_angle_d3d", "EGL_ANGLE_platform_angle_opengl", "EGL_ANGLE_platform_angle_null", "EGL_ANGLE_platform_angle_vulkan", "EGL_ANGLE_platform_angle_device_id", "EGL_ANGLE_device_creation", "EGL_ANGLE_device_creation_d3d11", "EGL_ANGLE_experimental_present_path", "EGL_KHR_client_get_all_proc_addresses", "EGL_KHR_debug", "EGL_ANGLE_feature_control", ] [2024-09-03T14:37:47-07:00 INFO blade_graphics::hal::platform] Display vendor "Google Inc. (NVIDIA)", version (1, 5) [2024-09-03T14:37:47-07:00 DEBUG blade_graphics::hal::platform] Display extensions: [ "EGL_EXT_create_context_robustness", "EGL_ANGLE_d3d_share_handle_client_buffer", "EGL_ANGLE_d3d_texture_client_buffer", "EGL_ANGLE_surface_d3d_texture_2d_share_handle", "EGL_ANGLE_query_surface_pointer", "EGL_ANGLE_window_fixed_size", "EGL_ANGLE_keyed_mutex", "EGL_ANGLE_surface_orientation", "EGL_ANGLE_direct_composition", "EGL_ANGLE_windows_ui_composition", "EGL_NV_post_sub_buffer", "EGL_KHR_create_context", "EGL_KHR_image", "EGL_KHR_image_base", "EGL_KHR_gl_texture_2D_image", "EGL_KHR_gl_texture_cubemap_image", "EGL_KHR_gl_renderbuffer_image", "EGL_KHR_get_all_proc_addresses", "EGL_KHR_stream", "EGL_KHR_stream_consumer_gltexture", "EGL_NV_stream_consumer_gltexture_yuv", "EGL_ANGLE_stream_producer_d3d_texture", "EGL_ANGLE_create_context_webgl_compatibility", "EGL_CHROMIUM_create_context_bind_generates_resource", "EGL_CHROMIUM_sync_control", "EGL_EXT_pixel_format_float", "EGL_KHR_surfaceless_context", "EGL_ANGLE_display_texture_share_group", "EGL_ANGLE_display_semaphore_share_group", "EGL_ANGLE_create_context_client_arrays", "EGL_ANGLE_program_cache_control", "EGL_ANGLE_robust_resource_initialization", "EGL_ANGLE_create_context_extensions_enabled", "EGL_ANDROID_blob_cache", "EGL_ANDROID_recordable", "EGL_ANGLE_image_d3d11_texture", "EGL_ANGLE_create_context_backwards_compatible", "EGL_KHR_no_config_context", "EGL_KHR_create_context_no_error", "EGL_KHR_reusable_sync", ] [2024-09-03T14:37:47-07:00 INFO blade_graphics::hal::platform] EGL surface: +srgb [2024-09-03T14:37:47-07:00 INFO blade_graphics::hal::platform] Trying native-render [2024-09-03T14:37:47-07:00 WARN blade_graphics::hal::platform] No config found! [2024-09-03T14:37:47-07:00 INFO blade_graphics::hal::platform] Trying presentation [2024-09-03T14:37:47-07:00 INFO blade_graphics::hal::platform] EGL context: +surfaceless [2024-09-03T14:37:47-07:00 DEBUG blade_graphics::hal::platform] Extensions: { "GL_EXT_blend_minmax", "GL_ANGLE_translated_shader_source", "GL_ANGLE_pack_reverse_row_order", "GL_OES_compressed_EAC_RG11_unsigned_texture", "GL_ANGLE_program_cache_control", "GL_EXT_texture_compression_rgtc", "GL_EXT_read_format_bgra", "GL_KHR_debug", "GL_ANGLE_texture_compression_dxt3", "GL_OES_compressed_ETC2_sRGB8_alpha8_texture", "GL_OES_compressed_EAC_R11_signed_texture", "GL_EXT_texture_filter_anisotropic", "GL_ANGLE_request_extension", "GL_ANGLE_base_vertex_base_instance", "GL_CHROMIUM_sync_query", "GL_EXT_blend_func_extended", "GL_EXT_clip_control", "GL_EXT_draw_buffers", "GL_EXT_texture_compression_s3tc_srgb", "GL_NV_framebuffer_blit", "GL_OES_compressed_ETC2_sRGB8_texture", "GL_OES_element_index_uint", "GL_CHROMIUM_bind_generates_resource", "GL_EXT_map_buffer_range", "GL_EXT_debug_label", "GL_ANGLE_client_arrays", "GL_EXT_texture_compression_dxt1", "GL_OES_compressed_EAC_R11_unsigned_texture", "GL_ANGLE_get_tex_level_parameter", "GL_OES_texture_half_float_linear", "GL_WEBGL_video_texture", "GL_ANGLE_copy_texture_3d", "GL_EXT_float_blend", "GL_CHROMIUM_copy_compressed_texture", "GL_NV_EGL_stream_consumer_external", "GL_OES_texture_stencil8", "GL_EXT_discard_framebuffer", "GL_ANGLE_get_serialized_context_string", "GL_CHROMIUM_copy_texture", "GL_EXT_draw_buffers_indexed", "GL_AMD_performance_monitor", "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_multi_draw", "GL_CHROMIUM_bind_uniform_location", "GL_ANGLE_texture_usage", "GL_NV_pack_subimage", "GL_EXT_texture_format_BGRA8888", "GL_ANGLE_multiview_multisample", "GL_ANGLE_texture_compression_dxt5", "GL_ANGLE_texture_multisample", "GL_EXT_disjoint_timer_query", "GL_EXT_robustness", "GL_ANGLE_lossy_etc_decode", "GL_EXT_texture_rg", "GL_OES_compressed_EAC_RG11_signed_texture", "GL_OES_compressed_ETC2_punchthroughA_RGBA8_texture", "GL_EXT_texture_storage", "GL_EXT_color_buffer_float", "GL_OES_EGL_image", "GL_OES_fbo_render_mipmap", "GL_OES_mapbuffer", "GL_EXT_multisampled_render_to_texture", "GL_EXT_sRGB", "GL_EXT_shader_texture_lod", "GL_EXT_texture_norm16", "GL_OES_standard_derivatives", "GL_OES_surfaceless_context", "GL_OES_texture_float_linear", "GL_OES_texture_half_float", "GL_OES_texture_npot", "GL_OVR_multiview", "GL_OES_vertex_array_object", "GL_ANGLE_framebuffer_blit", "GL_CHROMIUM_lose_context", "GL_ANGLE_framebuffer_multisample", "GL_EXT_occlusion_query_boolean", "GL_EXT_texture_compression_bptc", "GL_ANGLE_memory_size", "GL_EXT_color_buffer_half_float", "GL_OES_EGL_image_external", "GL_ANGLE_provoking_vertex", "GL_OES_compressed_ETC2_RGB8_texture", "GL_EXT_multi_draw_indirect", "GL_NV_pixel_buffer_object", "GL_KHR_parallel_shader_compile", "GL_OES_EGL_image_external_essl3", "GL_OES_rgb8_rgba8", "GL_EXT_EGL_image_external_wrap_modes", "GL_OES_draw_buffers_indexed", "GL_OES_texture_border_clamp", "GL_ANGLE_robust_client_memory", "GL_OVR_multiview2", "GL_ANGLE_depth_texture", "GL_OES_compressed_ETC2_RGBA8_texture", "GL_EXT_texture_type_2_10_10_10_REV", "GL_EXT_unpack_subimage", "GL_NV_fence", "GL_OES_depth32", "GL_OES_packed_depth_stencil", "GL_EXT_debug_marker", "GL_OES_draw_elements_base_vertex", "GL_EXT_frag_depth", "GL_OES_compressed_ETC2_punchthroughA_sRGB8_alpha_texture", "GL_OES_depth24", "GL_OES_get_program_binary", "GL_ANGLE_instanced_arrays", "GL_EXT_instanced_arrays", "GL_EXT_draw_elements_base_vertex", "GL_OES_texture_float", } [2024-09-03T14:37:47-07:00 INFO blade_graphics::hal::platform] Vendor: Google Inc. (NVIDIA) [2024-09-03T14:37:47-07:00 INFO blade_graphics::hal::platform] Renderer: ANGLE (NVIDIA, NVIDIA GeForce RTX 3080 Ti Laptop GPU Direct3D11 vs_5_0 ps_5_0, D3D11-32.0.15.6094) [2024-09-03T14:37:47-07:00 INFO blade_graphics::hal::platform] Version: OpenGL ES 3.0.0 (ANGLE 2.1.18912 git hash: 872d7947bb76) [2024-09-03T14:37:47-07:00 WARN blade_graphics::hal::platform] Unable to forbid exclusive full screen ```
Stacktrace ```rs Thread "main" panicked with "called `Result::unwrap()` on an `Err` value: MissingFeatures(Features(BUFFER_STORAGE | DYNAMIC_ARRAY_SIZE))" at C:\Users\\.cargo\git\checkouts\blade-b2bcd1de1cf7ab6a\fee06c4\blade-graphics\src\gles\pipeline.rs:158:14 0: backtrace::backtrace::dbghelp64::trace at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.73\src\backtrace\dbghelp64.rs:91 backtrace::backtrace::trace_unsynchronized at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.73\src\backtrace\mod.rs:66 1: backtrace::backtrace::trace at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.73\src\backtrace\mod.rs:53 2: backtrace::capture::Backtrace::create at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.73\src\capture.rs:197 3: backtrace::capture::Backtrace::new at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.73\src\capture.rs:162 4: zed::reliability::init_panic_hook::closure$0 at C:\Users\\Projects\zed\crates\zed\src\reliability.rs:58 5: alloc::boxed::impl$50::call at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\alloc\src\boxed.rs:2077 std::panicking::rust_panic_with_hook at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:799 6: std::panicking::begin_panic_handler::closure$0 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:664 7: std::sys_common::backtrace::__rust_end_short_backtrace at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:171 8: std::panicking::begin_panic_handler at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652 9: core::panicking::panic_fmt at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72 10: core::result::unwrap_failed at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\result.rs:1679 11: core::result::Result::unwrap at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\result.rs:1102 blade_graphics::hal::platform::Context::create_pipeline at C:\Users\\.cargo\git\checkouts\blade-b2bcd1de1cf7ab6a\fee06c4\blade-graphics\src\gles\pipeline.rs:150 12: blade_graphics::hal::platform::Context::create_render_pipeline at C:\Users\\.cargo\git\checkouts\blade-b2bcd1de1cf7ab6a\fee06c4\blade-graphics\src\gles\pipeline.rs:324 13: gpui::platform::blade::blade_renderer::BladePipelines::new at C:\Users\\Projects\zed\crates\gpui\src\platform\blade\blade_renderer.rs:229 14: gpui::platform::blade::blade_renderer::BladeRenderer::new at C:\Users\\Projects\zed\crates\gpui\src\platform\blade\blade_renderer.rs:377 15: gpui::platform::windows::window::windows_renderer::windows_renderer at C:\Users\\Projects\zed\crates\gpui\src\platform\windows\window.rs:1102 16: gpui::platform::windows::window::WindowsWindowState::new at C:\Users\\Projects\zed\crates\gpui\src\platform\windows\window.rs:90 17: gpui::platform::windows::window::WindowsWindowStatePtr::new at C:\Users\\Projects\zed\crates\gpui\src\platform\windows\window.rs:212 18: gpui::platform::windows::window::wnd_proc at C:\Users\\Projects\zed\crates\gpui\src\platform\windows\window.rs:953 19: DispatchMessageW 20: DispatchMessageW 21: CallNextHookEx 22: KiUserCallbackDispatcher 23: NtUserCreateWindowEx 24: CreateWindowExW 25: CreateWindowExW 26: CreateWindowExW 27: windows::Win32::UI::WindowsAndMessaging::CreateWindowExW,enum2$ > >,enum2$\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs:547 28: gpui::platform::windows::window::WindowsWindow::new at C:\Users\\Projects\zed\crates\gpui\src\platform\windows\window.rs:311 29: gpui::platform::windows::platform::impl$2::open_window at C:\Users\\Projects\zed\crates\gpui\src\platform\windows\platform.rs:323 30: gpui::window::Window::new at C:\Users\\Projects\zed\crates\gpui\src\window.rs:631 31: gpui::app::impl$4::open_window::closure$0 at C:\Users\\Projects\zed\crates\gpui\src\app.rs:506 32: gpui::app::AppContext::update,anyhow::Error> >,gpui::app::impl$4::open_window::closure_env$0\Projects\zed\crates\gpui\src\app.rs:362 33: gpui::app::AppContext::open_window at C:\Users\\Projects\zed\crates\gpui\src\app.rs:503 34: gpui::app::async_context::AsyncAppContext::open_window at C:\Users\\Projects\zed\crates\gpui\src\app\async_context.rs:154 35: workspace::impl$15::new_local::closure$0::async_block$0 at C:\Users\\Projects\zed\crates\workspace\src\workspace.rs:1175 36: core::future::future::impl$1::poll,alloc::vec::Vec,alloc::vec::Vec\.cargo\registry\src\index.crates.io-6f17d22bba15001f\async-task-4.7.1\src\runnable.rs:455 38: async_task::raw::RawTask::run,alloc::vec at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\async-task-4.7.1\src\raw.rs:557 39: async_task::runnable::Runnable::run > at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\async-task-4.7.1\src\runnable.rs:781 40: gpui::platform::windows::dispatcher::impl$2::dispatch_on_main_thread::closure$0 at C:\Users\\Projects\zed\crates\gpui\src\platform\windows\dispatcher.rs:111 41: windows::System::DispatcherQueueHandlerBox::Invoke at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\System\mod.rs:4697 42: CoreUICreateEx 43: CoreUICallReceive 44: CoreUICallReceive 45: CoreUICallReceive 46: CoreUICallReceive 47: CoreUICallReceive 48: CoreUICallReceive 49: CoreUICallReceive 50: CoreUICallReceive 51: DispatchMessageW 52: DispatchMessageW 53: GetClassLongW 54: KiUserCallbackDispatcher 55: NtUserPeekMessage 56: PeekMessageW 57: PeekMessageW 58: windows::Win32::UI::WindowsAndMessaging::PeekMessageW > > > at C:\Users\\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs:2413 59: gpui::platform::windows::platform::impl$2::run at C:\Users\\Projects\zed\crates\gpui\src\platform\windows\platform.rs:212 60: gpui::app::App::run at C:\Users\\Projects\zed\crates\gpui\src\app.rs:159 61: zed::main at C:\Users\\Projects\zed\crates\zed\src\main.rs:439 62: core::ops::function::FnOnce::call_once > at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\ops\function.rs:250 63: core::hint::black_box at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\hint.rs:338 std::sys_common::backtrace::__rust_begin_short_backtrace > at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\std\src\sys_common\backtrace.rs:155 64: std::rt::lang_start::closure$0 > at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\std\src\rt.rs:159 65: std::rt::lang_start_internal at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\rt.rs:141 66: std::rt::lang_start > at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\std\src\rt.rs:158 67: main 68: invoke_main at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78 __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 69: BaseThreadInitThunk 70: RtlUserThreadStart ```
kvark commented 2 months ago

Looks the same or similar to #163

kvark commented 2 months ago

Although, your case might be different, since you are on Angle. Looks like it exposes GLES-3.0, which is very basic. It's basically for compatibility only, and it matches WebGL2. Most of the examples aren't going to work. bunnymark should, though.

MolotovCherry commented 2 months ago

So to clarify, I'm compiling Zed to opengl on Windows. I don't really know anything about this library specifically, so I can only help to debug if given steps.

Is there anything specific I can do about this?

I'm happy to test anything out if it will help to solve this.

kvark commented 2 months ago

Thank you for offering to help! Is there a particular reason you are trying GLES on Windows, and not the proper Vulkan backend? I think the way to get that working via Angle/GLES is to first convince it to give use GLES-3.1 context (instead of 3.0).

MolotovCherry commented 2 months ago

My computer works fine with vulkan of course, but this is not always the case for others who may not have the luxury of vulkan, so I was trying to do what I could to help get it working for others so Zed can also be used by even more people. (Admittingly, despite my lack of knowledge regarding graphics backends)