WebEngineView cannot run WebGL
-
Good morning,
my goal is use WebEngine Qt Quick Minimal Example in order to visualize a WebGL. From the original example I have just modified the url that is now pointing to my webGL file index.html.
When I run the application the unityWebGl page it opens and blocks here:
As you can see there are some error in the console. What could be the problem?
I have tried to run the same webgl file with the quicknanobrowser example and it can load and it works. Why with minimal example is not working? Thanksimport QtQuick 2.12
import QtQuick.Window 2.12
import QtWebEngine 1.9Window {
width: 1024
height: 750
visible: true
WebEngineView {
anchors.fill:parent
url:"file:///C:/Users/administrator/WebGL/index.html"
}
} -
Good morning,
my goal is use WebEngine Qt Quick Minimal Example in order to visualize a WebGL. From the original example I have just modified the url that is now pointing to my webGL file index.html.
When I run the application the unityWebGl page it opens and blocks here:
As you can see there are some error in the console. What could be the problem?
I have tried to run the same webgl file with the quicknanobrowser example and it can load and it works. Why with minimal example is not working? Thanksimport QtQuick 2.12
import QtQuick.Window 2.12
import QtWebEngine 1.9Window {
width: 1024
height: 750
visible: true
WebEngineView {
anchors.fill:parent
url:"file:///C:/Users/administrator/WebGL/index.html"
}
}@DiegOne
display the pagechrome://gpu
and post the output plsare you also initializing the webengine like in the quicknanobrowser example in your main()?
https://code.qt.io/cgit/qt/qtwebengine.git/tree/examples/webengine/quicknanobrowser/main.cpp?h=5.15#n83 -
This is my main.cpp and webengine is initialized:
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <qtwebengineglobal.h>int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QtWebEngine::initialize();
QGuiApplication app(argc, argv);QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec();
}
Opening a chrome browser and displaying "chrome://gpu this is part of the output (is too long for a comment):
**Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Out-of-process Rasterization: Hardware accelerated
OpenGL: Enabled
Rasterization: Hardware accelerated
Skia Renderer: Enabled
Video Decode: Hardware accelerated
Vulkan: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
check_ycbcr_studio_g22_left_p709_for_nv12_support
clear_uniforms_before_first_program_use
decode_encode_srgb_for_generatemipmap
disable_accelerated_vp9_decode
disable_decode_swap_chain
disable_direct_composition_sw_video_overlays
enable_bgra8_overlays_with_yuv_overlay_support
enable_webgl_timer_query_extensions
exit_on_context_lost
max_msaa_sample_count_4
msaa_is_slow
disabled_extension_GL_KHR_blend_equation_advanced
disabled_extension_GL_KHR_blend_equation_advanced_coherent
Problems Detected
Some drivers are unable to reset the D3D device in the GPU process sandbox
Applied Workarounds: exit_on_context_lost
Clear uniforms before first program use on all platforms: 124764, 349137
Applied Workarounds: clear_uniforms_before_first_program_use
On Intel GPUs MSAA performance is not acceptable for GPU rasterization: 527565
Applied Workarounds: msaa_is_slow
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Decode and Encode before generateMipmap for srgb format textures on Windows: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
VP9 decoding is too slow on Intel Broadwell, Skylake, and CherryTrail: 616318
Applied Workarounds: disable_accelerated_vp9_decode
Expose WebGL's disjoint_timer_query extensions on platforms with site isolation: 808744, 870491
Applied Workarounds: enable_webgl_timer_query_extensions
Disable DecodeSwapChain for Intel Gen9 and older devices: 1107403
Applied Workarounds: disable_decode_swap_chain
Intel GPUs fail to report BGRA8 overlay support: 1119491
Applied Workarounds: enable_bgra8_overlays_with_yuv_overlay_support
8x MSAA for WebGL contexts is slow on Win Intel: 1145793
Applied Workarounds: max_msaa_sample_count_4
Software overlays fail to work reliably on AMD devices: 1161215, 1160217
Applied Workarounds: disable_direct_composition_sw_video_overlays
Disable software overlays for Intel GPUs. All Skylake+ devices support hw overlays, older devices peform poorly.: 1192748
Applied Workarounds: disable_direct_composition_sw_video_overlays
Check YCbCr_Studio_G22_Left_P709 color space for NV12 overlay support on Intel: 1103852
Applied Workarounds: check_ycbcr_studio_g22_left_p709_for_nv12_support
ANGLE Features
allow_compressed_formats (Frontend workarounds): Enabled: true
Allow compressed formats
disable_anisotropic_filtering (Frontend workarounds): Disabled
Disable support for anisotropic filtering
disable_program_binary (Frontend features) anglebug:5007: Disabled
Disable support for GL_OES_get_program_binary
disable_program_caching_for_transform_feedback (Frontend workarounds): Disabled
On some GPUs, program binaries don't contain transform feedback varyings
enableCompressingPipelineCacheInThreadPool (Frontend workarounds) anglebug:4722: Disabled: false
Enable compressing pipeline cache in thread pool.
enableProgramBinaryForCapture (Frontend features) anglebug:5658: Disabled
Even if FrameCapture is enabled, enable GL_OES_get_program_binary
enable_capture_limits (Frontend features) anglebug:5750: Disabled
Set the context limits like frame capturing was enabled
forceInitShaderVariables (Frontend features): Disabled
Force-enable shader variable initialization
forceRobustResourceInit (Frontend features) anglebug:6041: Disabled
Force-enable robust resource init
lose_context_on_out_of_memory (Frontend workarounds): Enabled: true
Some users rely on a lost context notification if a GL_OUT_OF_MEMORY error occurs
scalarize_vec_and_mat_constructor_args (Frontend workarounds) 1165751: Disabled: false
Always rewrite vec/mat constructors to be consistent
sync_framebuffer_bindings_on_tex_image (Frontend workarounds): Disabled
On some drivers TexImage sometimes seems to interact with the Framebuffer
add_mock_texture_no_render_target (D3D workarounds) anglebug:2152: Disabled: isIntel && capsVersion >= IntelDriverVersion(160000) && capsVersion < IntelDriverVersion(164815)
On some drivers when rendering with no render target, two bugs lead to incorrect behavior
allowES3OnFL10_0 (D3D workarounds): Disabled: false
Allow ES3 on 10.0 devices
allow_clear_for_robust_resource_init (D3D workarounds) 941620: Enabled: true
Some drivers corrupt texture data when clearing for robust resource initialization.
allow_translate_uniform_block_to_structured_buffer (D3D workarounds) anglebug:3682: Enabled: IsWin10OrGreater()
There is a slow fxc compile performance issue with dynamic uniform indexing if translating a uniform block with a large array member to cbuffer.
call_clear_twice (D3D workarounds) 655534: Disabled: isIntel && isSkylake && capsVersion >= IntelDriverVersion(160000) && capsVersion < IntelDriverVersion(164771)
Using clear() may not take effect
depth_stencil_blit_extra_copy (D3D workarounds) anglebug:1452: Disabled
Bug in some drivers triggers a TDR when using CopySubresourceRegion from a staging texture to a depth/stencil
disable_b5g6r5_support (D3D workarounds): Disabled: (isIntel && capsVersion >= IntelDriverVersion(150000) && capsVersion < IntelDriverVersion(154539)) || isAMD
Textures with the format DXGI_FORMAT_B5G6R5_UNORM have incorrect data
emulate_isnan_float (D3D workarounds) 650547: Disabled: isIntel && isSkylake && capsVersion >= IntelDriverVersion(160000) && capsVersion < IntelDriverVersion(164542)
Using isnan() on highp float will get wrong answer
emulate_tiny_stencil_textures (D3D workarounds): Disabled: isAMD && !(deviceCaps.featureLevel < D3D_FEATURE_LEVEL_10_1)
1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly
expand_integer_pow_expressions (D3D workarounds): Enabled: true
The HLSL optimizer has a bug with optimizing 'pow' in certain integer-valued expressions
flush_after_ending_transform_feedback (D3D workarounds): Disabled: isNvidia
Some drivers sometimes write out-of-order results to StreamOut buffers when transform feedback is used to repeatedly write to the same buffer positions
force_atomic_value_resolution (D3D workarounds) anglebug:3246: Disabled: isNvidia
On some drivers the return value from RWByteAddressBuffer.InterlockedAdd does not resolve when used in the .yzw components of a RWByteAddressBuffer.Store operation
get_dimensions_ignores_base_level (D3D workarounds): Disabled: isNvidia
Some drivers do not take into account the base level of the texture in the results of the HLSL GetDimensions builtin
mrt_perf_workaround (D3D workarounds): Enabled: true
Some drivers have a bug where they ignore null render targets
pre_add_texel_fetch_offsets (D3D workarounds): Enabled: isIntel
HLSL's function texture.Load returns 0 when the parameter Location is negative, even if the sum of Offset and Location is in range
rewrite_unary_minus_operator (D3D workarounds): Disabled: isIntel && (isBroadwell || isHaswell) && capsVersion >= IntelDriverVersion(150000) && capsVersion < IntelDriverVersion(154624)
Evaluating unary minus operator on integer may get wrong answer in vertex shaders
select_view_in_geometry_shader (D3D workarounds): Disabled: !deviceCaps.supportsVpRtIndexWriteFromVertexShader
The viewport or render target slice will be selected in the geometry shader stage for the ANGLE_multiview extension
set_data_faster_than_image_upload (D3D workarounds): Enabled: !(isIvyBridge || isBroadwell || isHaswell)
Set data faster than image upload
skip_vs_constant_register_zero (D3D workarounds): Disabled: isNvidia
In specific cases the driver doesn't handle constant register zero correctly
use_instanced_point_sprite_emulation (D3D workarounds): Disabled: isFeatureLevel9_3
Some D3D11 renderers do not support geometry shaders for pointsprite emulation
use_system_memory_for_constant_buffers (D3D workarounds) 593024: Enabled: isIntel
Copying from staging storage to constant buffer storage does not work
zero_max_lod (D3D workarounds): Disabled: isFeatureLevel9_3
Missing an option to disable mipmaps on a mipmapped texture
DAWN Info<Integrated GPU> D3D12 backend - Intel(R) HD Graphics 520
[Default Toggle Names]
lazy_clear_resource_on_first_use: https://crbug.com/dawn/145: Clears resource to zero on first usage. This initializes the resource so that no dirty bits from recycled memory is present in the new resource.
use_d3d12_resource_heap_tier2: https://crbug.com/dawn/27: Enable support for resource heap tier 2. Resource heap tier 2 allows mixing of texture and buffers in the same heap. This allows better heap re-use and reduces fragmentation.
use_d3d12_render_pass: https://crbug.com/dawn/36: Use the D3D12 render pass API introduced in Windows build 1809 by default. On versions of Windows prior to build 1809, or when this toggle is turned off, Dawn will emulate a render pass.
use_d3d12_residency_management: https://crbug.com/dawn/193: Enable residency management. This allows page-in and page-out of resource heaps in GPU memory. This component improves overcommitted performance by keeping the most recently used resources local to the GPU. Turning this component off can cause allocation failures when application memory exceeds physical device memory.
disallow_unsafe_apis: http://crbug.com/1138528: Produces validation errors on API entry points or parameter combinations that aren't considered secure yet.
use_tint_generator: https://crbug.com/dawn/571: Use Tint instead of SPRIV-cross to generate shaders.
use_temp_buffer_in_small_format_texture_to_texture_copy_from_greater_to_less_mip_level: https://crbug.com/1161355: Split texture-to-texture copy into two copies: copy from source texture into a temporary buffer, and copy from the temporary buffer into the destination texture under specific situations. This workaround is by default enabled on some Intel GPUs which have a driver bug in the execution of CopyTextureRegion() when we copy with the formats whose texel block sizes are less than 4 bytes from a greater mip level to a smaller mip level on D3D12 backends.
[WebGPU Forced Toggles - enabled]
disallow_spirv: https://crbug.com/1214923: Disallow usage of SPIR-V completely so that only WGSL is used for shader modules.This is useful to prevent a Chromium renderer process from successfully sendingSPIR-V code to be compiled in the GPU process.
[Supported Extensions]
texture_compression_bc
pipeline_statistics_query
timestamp_query
multiplanar_formats
dawn-internal-usages<Discrete GPU> D3D12 backend - AMD FirePro W4190M
[Default Toggle Names]
lazy_clear_resource_on_first_use: https://crbug.com/dawn/145: Clears resource to zero on first usage. This initializes the resource so that no dirty bits from recycled memory is present in the new resource.
use_d3d12_resource_heap_tier2: https://crbug.com/dawn/27: Enable support for resource heap tier 2. Resource heap tier 2 allows mixing of texture and buffers in the same heap. This allows better heap re-use and reduces fragmentation.
use_d3d12_render_pass: https://crbug.com/dawn/36: Use the D3D12 render pass API introduced in Windows build 1809 by default. On versions of Windows prior to build 1809, or when this toggle is turned off, Dawn will emulate a render pass.
use_d3d12_residency_management: https://crbug.com/dawn/193: Enable residency management. This allows page-in and page-out of resource heaps in GPU memory. This component improves overcommitted performance by keeping the most recently used resources local to the GPU. Turning this component off can cause allocation failures when application memory exceeds physical device memory.
disallow_unsafe_apis: http://crbug.com/1138528: Produces validation errors on API entry points or parameter combinations that aren't considered secure yet.
use_tint_generator: https://crbug.com/dawn/571: Use Tint instead of SPRIV-cross to generate shaders.
[WebGPU Forced Toggles - enabled]
disallow_spirv: https://crbug.com/1214923: Disallow usage of SPIR-V completely so that only WGSL is used for shader modules.This is useful to prevent a Chromium renderer process from successfully sendingSPIR-V code to be compiled in the GPU process.
[Supported Extensions]
texture_compression_bc
pipeline_statistics_query
timestamp_query
multiplanar_formats
dawn-internal-usages<CPU> D3D12 backend - Microsoft Basic Render Driver
[Default Toggle Names]
lazy_clear_resource_on_first_use: https://crbug.com/dawn/145: Clears resource to zero on first usage. This initializes the resource so that no dirty bits from recycled memory is present in the new resource.
use_d3d12_resource_heap_tier2: https://crbug.com/dawn/27: Enable support for resource heap tier 2. Resource heap tier 2 allows mixing of texture and buffers in the same heap. This allows better heap re-use and reduces fragmentation.
use_d3d12_render_pass: https://crbug.com/dawn/36: Use the D3D12 render pass API introduced in Windows build 1809 by default. On versions of Windows prior to build 1809, or when this toggle is turned off, Dawn will emulate a render pass.
use_d3d12_residency_management: https://crbug.com/dawn/193: Enable residency management. This allows page-in and page-out of resource heaps in GPU memory. This component improves overcommitted performance by keeping the most recently used resources local to the GPU. Turning this component off can cause allocation failures when application memory exceeds physical device memory.
disallow_unsafe_apis: http://crbug.com/1138528: Produces validation errors on API entry points or parameter combinations that aren't considered secure yet.
use_tint_generator: https://crbug.com/dawn/571: Use Tint instead of SPRIV-cross to generate shaders.
[WebGPU Forced Toggles - enabled]
disallow_spirv: https://crbug.com/1214923: Disallow usage of SPIR-V completely so that only WGSL is used for shader modules.This is useful to prevent a Chromium renderer process from successfully sendingSPIR-V code to be compiled in the GPU process.
[Supported Extensions]
texture_compression_bc
pipeline_statistics_query
timestamp_query
multiplanar_formats
dawn-internal-usages<Integrated GPU> Vulkan backend - Intel(R) HD Graphics 520
[Default Toggle Names]
lazy_clear_resource_on_first_use: https://crbug.com/dawn/145: Clears resource to zero on first usage. This initializes the resource so that no dirty bits from recycled memory is present in the new resource.
use_temporary_buffer_in_texture_to_texture_copy: https://crbug.com/dawn/42: Split texture-to-texture copy into two copies: copy from source texture into a temporary buffer, and copy from the temporary buffer into the destination texture when copying between compressed textures that don't have block-aligned sizes. This workaround is enabled by default on all Vulkan drivers to solve an issue in the Vulkan SPEC about the texture-to-texture copies with compressed formats. See #1005 (https://github.com/KhronosGroup/Vulkan-Docs/issues/1005) for more details.
vulkan_use_d32s8: https://crbug.com/dawn/286: Vulkan mandates support of either D32_FLOAT_S8 or D24_UNORM_S8. When available the backend will use D32S8 (toggle to on) but setting the toggle to off will make ituse the D24S8 format when possible.
disallow_unsafe_apis: http://crbug.com/1138528: Produces validation errors on API entry points or parameter combinations that aren't considered secure yet.
use_tint_generator: https://crbug.com/dawn/571: Use Tint instead of SPRIV-cross to generate shaders.
[WebGPU Forced Toggles - enabled]
disallow_spirv: https://crbug.com/1214923: Disallow usage of SPIR-V completely so that only WGSL is used for shader modules.This is useful to prevent a Chromium renderer process from successfully sendingSPIR-V code to be compiled in the GPU process.
[Supported Extensions]
texture_compression_bc
texture-compression-etc2
texture-compression-astc
pipeline_statistics_query
timestamp_query
dawn-internal-usages<Discrete GPU> Vulkan backend - AMD FirePro W4190M
[Default Toggle Names]
lazy_clear_resource_on_first_use: https://crbug.com/dawn/145: Clears resource to zero on first usage. This initializes the resource so that no dirty bits from recycled memory is present in the new resource.
use_temporary_buffer_in_texture_to_texture_copy: https://crbug.com/dawn/42: Split texture-to-texture copy into two copies: copy from source texture into a temporary buffer, and copy from the temporary buffer into the destination texture when copying between compressed textures that don't have block-aligned sizes. This workaround is enabled by default on all Vulkan drivers to solve an issue in the Vulkan SPEC about the texture-to-texture copies with compressed formats. See #1005 (https://github.com/KhronosGroup/Vulkan-Docs/issues/1005) for more details.
vulkan_use_d32s8: https://crbug.com/dawn/286: Vulkan mandates support of either D32_FLOAT_S8 or D24_UNORM_S8. When available the backend will use D32S8 (toggle to on) but setting the toggle to off will make ituse the D24S8 format when possible.
disallow_unsafe_apis: http://crbug.com/1138528: Produces validation errors on API entry points or parameter combinations that aren't considered secure yet.
use_tint_generator: https://crbug.com/dawn/571: Use Tint instead of SPRIV-cross to generate shaders.
[WebGPU Forced Toggles - enabled]
disallow_spirv: https://crbug.com/1214923: Disallow usage of SPIR-V completely so that only WGSL is used for shader modules.This is useful to prevent a Chromium renderer process from successfully sendingSPIR-V code to be compiled in the GPU process.
[Supported Extensions]
texture_compression_bc
pipeline_statistics_query
timestamp_query
dawn-internal-usages
Version Information
Data exported 2021-11-18T10:08:33.441Z
Chrome version Chrome/95.0.4638.69
Operating system Windows NT 10.0.19043
Software rendering list URL https://chromium.googlesource.com/chromium/src/+/6a1600ed572fedecd573b6c2b90a22fe6392a410/gpu/config/software_rendering_list.json
Driver bug list URL https://chromium.googlesource.com/chromium/src/+/6a1600ed572fedecd573b6c2b90a22fe6392a410/gpu/config/gpu_driver_bug_list.json
ANGLE commit id 115fe74c8cee
2D graphics backend Skia/95 565e21c650d81ce861d0d54b0dd4fc247ad58ae6
Command Line "C:\Program Files\Google\Chrome\Application\chrome.exe" --flag-switches-begin --enable-webgl-developer-extensions --enable-webgl-draft-extensions --flag-switches-end --origin-trial-disabled-features=CaptureHandle
Driver Information
Initialization time 673
In-process GPU false
Passthrough Command Decoder true
Sandboxed true
GPU0 VENDOR= 0x8086, DEVICE=0x1916, SUBSYS=0x8079103c, REV=7, LUID={0,47808} ACTIVE
GPU1 VENDOR= 0x1002, DEVICE=0x6604, SUBSYS=0x8150103c, REV=129, LUID={0,53865}
GPU2 VENDOR= 0x1414, DEVICE=0x008c, LUID={0,53811}
Optimus false
AMD switchable false
Desktop compositing Aero Glass
Direct composition true
Supports overlays true
YUY2 overlay support SOFTWARE
NV12 overlay support SOFTWARE
BGRA8 overlay support SOFTWARE
RGB10A2 overlay support SOFTWARE
Diagonal Monitor Size of \.\DISPLAY1 15.5"
Diagonal Monitor Size of \.\DISPLAY2 23.7"
Driver D3D12 feature level D3D 12.1
Driver Vulkan API version Vulkan API 1.2.0 -
Solved, It was necessary to build the project in release mode. I was building in debug mode.
@DiegOne
hmm, still rather strange