diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index 3e1add825e..888719fd84 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -411,6 +411,11 @@ impl super::Adapter { wgt::DownlevelFlags::MULTISAMPLED_SHADING, supported((3, 2), (4, 0)) || extensions.contains("OES_sample_variables"), ); + let query_buffers = extensions.contains("GL_ARB_query_buffer_object") + || extensions.contains("GL_AMD_query_buffer_object"); + if query_buffers { + downlevel_flags.set(wgt::DownlevelFlags::NONBLOCKING_QUERY_RESOLVE, true); + } let mut features = wgt::Features::empty() | wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES @@ -450,9 +455,7 @@ impl super::Adapter { supported((3, 1), (4, 2)) || extensions.contains("GL_ARB_shader_image_load_store"), ); features.set(wgt::Features::SHADER_UNUSED_VERTEX_OUTPUT, true); - let query_buffers = extensions.contains("GL_ARB_query_buffer_object") - || extensions.contains("GL_AMD_query_buffer_object"); - if extensions.contains("GL_ARB_timer_query") && query_buffers { + if extensions.contains("GL_ARB_timer_query") { features.set(wgt::Features::TIMESTAMP_QUERY, true); features.set(wgt::Features::TIMESTAMP_QUERY_INSIDE_PASSES, true); } diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index ec968f9e31..82989598ef 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -1463,6 +1463,23 @@ bitflags::bitflags! { /// /// The GLES/WebGL and Vulkan on Android doesn't support this. const SURFACE_VIEW_FORMATS = 1 << 21; + + /// If this is true, calls to `CommandEncoder::resolve_query_set` will be performed on the queue timeline. + /// + /// If this is false, calls to `CommandEncoder::resolve_query_set` will be performed on the device (i.e. cpu) timeline + /// and will block that timeline until the query has data. You may work around this limitation by waiting until the submit + /// whose queries you are resolving is fully finished (through use of `queue.on_submitted_work_done`) and only + /// then submitting the resolve_query_set command. The queries will be guarenteed finished, so will not block. + /// + /// Supported by: + /// - Vulkan, + /// - DX12 + /// - Metal + /// - OpenGL 4.4+ + /// + /// Not Supported by: + /// - GL ES / WebGL + const NONBLOCKING_QUERY_RESOLVE = 1 << 22; } }