New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 658074 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
OOO until 2019-01-24
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocked on:
issue 510637

Blocking:
issue 778871
issue angleproject:2088



Sign in to add a comment

toji.github.io/webgl2-particles-2 breaks on Qualcomm GPUs upon page reload

Project Member Reported by kbr@chromium.org, Oct 21 2016

Issue description

The transform feedback demo http://toji.github.io/webgl2-particles-2/ frequently breaks on the Nexus 5X and 6P when the page is reloaded.

Debugging indicates that glBeginTransformFeedback (called by the transform feedback pass in the demo) is generating a GL_INVALID_OPERATION. I instrumented a ChromePublic.apk build on Android, and found that the error is coming from the driver -- when GLES2DecoderImpl::DoBeginTransformFeedback calls:

  transform_feedback->DoBeginTransformFeedback(primitive_mode);

The command buffer's validation is supposed to ensure that this can't happen. The same problem doesn't happen on the Pixel C, which uses an NVIDIA GPU, and it also doesn't happen on desktop Linux.

I thought at first this was a bug in the virtual context handling in the command buffer, where if a GLES2DecoderImpl was destroyed while a transform feedback was begun, it would fail to call glEndTransformFeedback. Code inspection indicates the TransformFeedbackManager handles this case, and I added queries of the GL state just before calling glBeginTransformFeedback -- there was no active transform feedback.

I suspect that Qualcomm's driver maintains the transform feedback's indexed binding points incorrectly -- as members of the context state rather than the transform feedback object. Will need to try adding workaround code to confirm this.

 

Comment 1 by kbr@chromium.org, Oct 25 2016

This is happening on the new Google Pixel too. about:gpu follows. All of the errors at the bottom are consequences of the glBeginTransformFeedback call failing with a GL_INVALID_OPERATION error after the page is reloaded.

To reproduce this with Chrome Dev on Android, go to about:flags, enable the WebGL 2.0 prototype, and navigate to the above demo. Then reload the page.

Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Disabled
Native GpuMemoryBuffers: Software only. Hardware acceleration disabled
Rasterization: Hardware accelerated
Video Decode: Hardware accelerated
Video Encode: Software only, hardware acceleration unavailable
VPx Video Decode: Hardware accelerated
WebGL: Hardware accelerated
Driver Bug Workarounds
clear_uniforms_before_first_program_use
disable_chromium_framebuffer_multisample
disable_depth_texture
disable_framebuffer_cmaa
disable_program_disk_cache
force_cube_map_positive_x_allocation
max_copy_texture_chromium_size_1048576
max_texture_size_limit_4096
scalarize_vec_and_mat_constructor_args
unbind_egl_context_to_flush_driver_caches
use_virtualized_gl_contexts
wake_up_gpu_before_drawing
Problems Detected
MediaCodec is still too buggy to use for encoding (b/11536167): 615108
Disabled Features: accelerated_video_encode
Disable depth textures on Android with Qualcomm GPUs
Applied Workarounds: disable_depth_texture
Non-virtual contexts on Qualcomm sometimes cause out-of-order frames: 289461
Applied Workarounds: use_virtualized_gl_contexts
The first draw operation from an idle state is slow: 309734
Applied Workarounds: wake_up_gpu_before_drawing
ES3 MSAA is broken on Qualcomm
Applied Workarounds: disable_chromium_framebuffer_multisample
Clear uniforms before first program use on all platforms: 124764, 349137
Applied Workarounds: clear_uniforms_before_first_program_use
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
Certain Adreno 4xx and 5xx drivers often crash in glProgramBinary.: 486117, 598060
Applied Workarounds: disable_program_disk_cache
glFinish doesn't clear caches on Android: 509727
Applied Workarounds: unbind_egl_context_to_flush_driver_caches
Android Adreno crashes on binding incomplete cube map texture to FBO: 518889
Applied Workarounds: force_cube_map_positive_x_allocation
CHROMIUM_copy_texture with 1MB copy per flush to avoid unwanted cache growth on Adreno: 542478
Applied Workarounds: max_copy_texture_chromium_size_1048576
Limit max texure size to 4096 on all of Android
Applied Workarounds: max_texture_size_limit_4096
Limited enabling of Chromium GL_INTEL_framebuffer_CMAA: 535198
Applied Workarounds: disable_framebuffer_cmaa
Raster is using a single thread.
Disabled Features: multiple_raster_threads
Native GpuMemoryBuffers have been disabled, either via about:flags or command line.
Disabled Features: native_gpu_memory_buffers
Version Information
Data exported	10/25/2016, 1:44:20 PM
Chrome version	Chrome/56.0.2895.3
Operating system	Android 7.1.0
Software rendering list version	11.17
Driver bug list version	9.10
ANGLE commit id	336b147073e0
2D graphics backend	Skia/55 e719577fe8ac3de38795cde2007337f854d97435
Command Line Args	--use-mobile-user-agent --top-controls-show-threshold=0.5 --top-controls-hide-threshold=0.5 --use-mobile-user-agent --enable-pinch --enable-viewport --enable-overlay-scrollbar --validate-input-event-stream --enable-longpress-drag-selection --touch-selection-strategy=direction --disable-gpu-process-crash-limit --main-frame-resizes-are-orientation-changes --disable-composited-antialiasing --ui-prioritize-in-gpu-process --profiler-timing=0 --prerender-from-omnibox=enabled --enable-dom-distiller --flag-switches-begin --enable-unsafe-es3-apis --flag-switches-end --enable-instant-extended-api
Driver Information
Initialization time	199
In-process GPU	false
Sandboxed	false
GPU0	VENDOR = 0x0000 [Qualcomm], DEVICE= 0x0000 [Adreno (TM) 530]
Optimus	false
AMD switchable	false
Driver vendor	
Driver version	145.0
Driver date	
Pixel shader version	3.20
Vertex shader version	3.20
Max. MSAA samples	4
Machine model name	Pixel
Machine model version	
GL_VENDOR	Qualcomm
GL_RENDERER	Adreno (TM) 530
GL_VERSION	OpenGL ES 3.2 V@145.0 (GIT@If9312edd27)
GL_EXTENSIONS	GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_half_float GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_compressed_ETC1_RGB8_texture GL_AMD_compressed_ATC_texture GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_OES_texture_compression_astc GL_OES_texture_npot GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_OES_texture_3D GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_QCOM_alpha_test GL_OES_depth24 GL_OES_packed_depth_stencil GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_EXT_sRGB GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_EXT_texture_type_2_10_10_10_REV GL_EXT_texture_sRGB_decode GL_OES_element_index_uint GL_EXT_copy_image GL_EXT_geometry_shader GL_EXT_tessellation_shader GL_OES_texture_stencil8 GL_EXT_shader_io_blocks GL_OES_shader_image_atomic GL_OES_sample_variables GL_EXT_texture_border_clamp GL_EXT_multisampled_render_to_texture GL_OES_shader_multisample_interpolation GL_EXT_texture_cube_map_array GL_EXT_draw_buffers_indexed GL_EXT_gpu_shader5 GL_EXT_robustness GL_EXT_texture_buffer GL_EXT_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_OES_texture_storage_multisample_2d_array GL_OES_sample_shading GL_OES_get_program_binary GL_EXT_debug_label GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_QCOM_tiled_rendering GL_ANDROID_extension_pack_es31a GL_EXT_primitive_bounding_box GL_OES_standard_derivatives GL_OES_vertex_array_object GL_EXT_disjoint_timer_query GL_KHR_debug GL_EXT_YUV_target GL_EXT_sRGB_write_control GL_EXT_texture_norm16 GL_EXT_discard_framebuffer GL_OES_surfaceless_context GL_OVR_multiview GL_OVR_multiview2 GL_EXT_texture_sRGB_R8 GL_KHR_no_error GL_EXT_debug_marker GL_OES_EGL_image_external_essl3 GL_OVR_multiview_multisampled_render_to_texture GL_EXT_buffer_storage GL_EXT_blit_framebuffer_params GL_EXT_clip_cull_distance GL_EXT_protected_textures
Disabled Extensions	GL_OES_depth_texture
Window system binding vendor	
Window system binding version	
Window system binding extensions	
Direct rendering	Yes
Reset notification strategy	0x8252
GPU process crash count	0
Compositor Information
Tile Update Mode	One-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
ATC	Software only
ATCIA	Software only
DXT1	Software only
DXT5	Software only
ETC1	Software only
R_8	Software only
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	Software only
RGBA_8888	Software only
BGRX_8888	Software only
BGRA_8888	Software only
YVU_420	Software only
YUV_420_BIPLANAR	Software only
UYVY_422	Software only
Log Messages
[ERROR:gles2_cmd_decoder.cc(16615)] : [.Offscreen-MainThread-0xc4f35000.CmdBufferImageTransportFactory-0xc4ffa600]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[ERROR:gles2_cmd_decoder.cc(9305)] : [.Offscreen-MainThread-0xc4f35000.CmdBufferImageTransportFactory-0xc4ffa600]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
[ERROR:gles2_cmd_decoder.cc(7621)] : [.Offscreen-For-WebGL-0xd0b7c000]GL ERROR :GL_INVALID_OPERATION : glFramebufferTexture2D: <- error from previous GL command
[ERROR:gles2_cmd_decoder.cc(7621)] : [.Offscreen-For-WebGL-0xd0b7c000]GL ERROR :GL_INVALID_OPERATION : glFramebufferTexture2D: <- error from previous GL command
...

Comment 2 by kbr@chromium.org, Oct 25 2016

Status: Available (was: Untriaged)

Comment 3 by kbr@chromium.org, Oct 25 2016

Note: I built Chromium with the use_virtualized_gl_contexts driver bug workaround disabled in src/gpu/config/gpu_driver_bug_list_json.cc and the problem still occurred on the Google Pixel. This reinforces the hypothesis that it's a bug in the driver.

Comment 4 by kbr@chromium.org, Oct 25 2016

Filed internal bug b/32414209 against Qualcomm about this issue.

Comment 5 by kbr@chromium.org, Oct 25 2016

zmo@ pointed out it would be pretty easy to test a workaround, so I did in the attached patch, which restores the GL_TRANSFORM_FEEDBACK_BUFFER indexed binding points each time BindTransformFeedback is called (including during virtualized context changes). Unfortunately it had no effect.

transform-feedback-virtualization.patch
4.1 KB Download

Comment 6 by kbr@chromium.org, Oct 25 2016

Summary: toji.github.io/webgl2-particles-2 breaks on Qualcomm GPUs upon page reload (was: toji.github.io/webgl2-particles-2 breaks on Nexus 5X and 6P upon page reload)

Comment 7 by kbr@chromium.org, Dec 1 2016

Blockedon: 510637
Cc: vmi...@chromium.org
Owner: kainino@chromium.org
Status: Assigned (was: Available)
Per feedback on b/32414209 , it sounds like in Qualcomm's current drivers, the binaries returned from glGetProgramBinary are missing the transform feedback varying information. This is the reason this only happens upon page reload; it's only on the second and subsequent load of the program that Chromium discovers that it has a cached program binary to use.

There's already a driver bug workaround for this: disable_program_cache . It was last used in Issue 510637. I'm reluctant to use it here, because it might impact the startup performance of Chrome's compositor. Perhaps we need to add a new workaround like disable_program_cache_for_webgl2 (under the assumption that Chrome's internals would never use transform feedback).

Kai, may I assign this to you? We'll need to talk with others to determine the most reasonable workaround.

Comment 8 by kbr@chromium.org, Jan 4 2017

Owner: kbr@chromium.org
Status: Started (was: Assigned)
Taking this from Kai, since per offline conversation with Victor, we'll definitely need a new workaround type. Disabling program caching for programs intended for transform feedback (i.e., where the transform feedback varyings are non-empty) seems like a good targeted workaround.

Project Member

Comment 9 by bugdroid1@chromium.org, Jan 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7db45ad0084e0622951df2e14c4c411349ef7338

commit 7db45ad0084e0622951df2e14c4c411349ef7338
Author: kbr <kbr@chromium.org>
Date: Wed Jan 04 19:26:11 2017

Add disable_program_caching_for_transform_feedback workaround.

All current Qualcomm GPUs are affected by a bug where program binaries
don't cache transform feedback varyings. Work around this by avoiding
the use of the in-memory and disk program caches when the transform
feedback varyings are non-empty.

BUG= 658074 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2615573002
Cr-Commit-Position: refs/heads/master@{#441433}

[modify] https://crrev.com/7db45ad0084e0622951df2e14c4c411349ef7338/gpu/command_buffer/service/memory_program_cache.cc
[modify] https://crrev.com/7db45ad0084e0622951df2e14c4c411349ef7338/gpu/command_buffer/service/memory_program_cache.h
[modify] https://crrev.com/7db45ad0084e0622951df2e14c4c411349ef7338/gpu/command_buffer/service/memory_program_cache_unittest.cc
[modify] https://crrev.com/7db45ad0084e0622951df2e14c4c411349ef7338/gpu/config/gpu_driver_bug_list_json.cc
[modify] https://crrev.com/7db45ad0084e0622951df2e14c4c411349ef7338/gpu/config/gpu_driver_bug_workaround_type.h
[modify] https://crrev.com/7db45ad0084e0622951df2e14c4c411349ef7338/gpu/ipc/in_process_command_buffer.cc
[modify] https://crrev.com/7db45ad0084e0622951df2e14c4c411349ef7338/gpu/ipc/service/gpu_channel_manager.cc

Comment 10 by kbr@chromium.org, Jan 4 2017

Status: Fixed (was: Started)
Blocking: angleproject:2088

Comment 12 by kbr@chromium.org, Oct 27 2017

Blocking: 778871

Sign in to add a comment