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

Issue 639384 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

gl.copyTexSubImage2D leaves previous render data on ANGLE DX9 only

Reported by alecazam...@gmail.com, Aug 19 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Example URL:
https://www.figma.com/file/1O1hwP9T0yrKMMn1XuD4hn/Screen4-Min1-Broken-(Copy)

Steps to reproduce the problem:
1. Start the browser with -use-angle=d3d9 on command line
2. Open the link provided (must have Figma account) 
3. Validate in chrome:/gpu that the D3D9 path is active
4. Export the existing scene, and watch the previous render data appear in the export and on the interactive views

5. Restart with another shortcut with -use-angle=d3d11 (or just use the default setting if you're on a new enough card).  Note that you never get previous render data displayed.

What is the expected behavior?
No previous render data is displayed.  This seems like a security issue, and also maybe the reason that a lot of drivers were blacklisted.

What went wrong?
It seems to be a bug in the scissor vs. clear state management system and gl.copyTexSubImage2D interactions.  We leave scissor for all of our rendering, but scissor isn't supposed to affect gl.copyTexSubImage2D nor do we rely on it there.

This likely occurs on Firefox and other Angle-based WebGL implementation, but it's unclear how to force the D3D9 backend on a modern GPU.  I've tested and reproduced this on Intel, Nvidia, and AMD on newer and older cards, so it's specific to ANGLE DX9 and not a specific vendor or driver.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? N/A 

Chrome version: 52.0.2743.116  Channel: stable
OS Version: Windows 8.1, 10
Flash Version: Shockwave Flash 22.0 r0
 
Components: -Blink Blink>WebGL Internals>Graphics

Comment 2 by kbr@chromium.org, Aug 20 2016

Cc: geoffl...@chromium.org jmad...@chromium.org
Components: Internals>GPU>ANGLE
Owner: jmad...@chromium.org
Status: Assigned (was: Unconfirmed)
Alec, can you provide a clear screenshot showing the bad previous render data? I just tried this and wasn't able to reproduce- at least I wasn't sure what I was looking for. I also noticed the text seemed inverted still in D3D9 and D3D11.

Comment 4 by kbr@chromium.org, Aug 23 2016

I also don't see garbage in the exported file or on the screen, but I'm also not sure what to look for. This is on a Windows workstation with AMD GPU and Chrome Canary. about:gpu posted below. Please provide about:gpu from an affected machine.

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: Enabled
Native GpuMemoryBuffers: Software only. Hardware acceleration disabled
Rasterization: Software only. Hardware acceleration disabled
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
VPx Video Decode: Software only, hardware acceleration unavailable
WebGL: Hardware accelerated
Driver Bug Workarounds
clear_uniforms_before_first_program_use
disable_direct_composition
disable_discard_framebuffer
disable_dxgi_zero_copy_video
disable_framebuffer_cmaa
exit_on_context_lost
force_cube_complete
scalarize_vec_and_mat_constructor_args
texsubimage_faster_than_teximage
Problems Detected
VPx decoding isn't supported before Windows 10 anniversary update.: 616318
Disabled Features: accelerated_vpx_decode
Some drivers are unable to reset the D3D device in the GPU process sandbox
Applied Workarounds: exit_on_context_lost
TexSubImage is faster for full uploads on ANGLE
Applied Workarounds: texsubimage_faster_than_teximage
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
ANGLE crash on glReadPixels from incomplete cube map texture: 518889
Applied Workarounds: force_cube_complete
Framebuffer discarding can hurt performance on non-tilers: 570897
Applied Workarounds: disable_discard_framebuffer
Direct composition flashes black initially on Win <10: 588588
Applied Workarounds: disable_direct_composition
Zero copy DXGI video hangs on shutdown on Win < 8.1: 621190
Applied Workarounds: disable_dxgi_zero_copy_video
Zero copy DXGI video hangs on AMD drivers: 623029
Applied Workarounds: disable_dxgi_zero_copy_video
Limited enabling of Chromium GL_INTEL_framebuffer_CMAA: 535198
Applied Workarounds: disable_framebuffer_cmaa
Accelerated rasterization has been disabled, either via blacklist, about:flags or the command line.
Disabled Features: rasterization
Native GpuMemoryBuffers have been disabled, either via about:flags or command line.
Disabled Features: native_gpu_memory_buffers
Version Information
Data exported	8/23/2016, 2:10:47 PM
Chrome version	Chrome/54.0.2837.0
Operating system	Windows NT 6.3.9600
Software rendering list version	11.10
Driver bug list version	8.85
ANGLE commit id	3fdec9194941
2D graphics backend	Skia/54 d9015a43cf6c6e7c372c804ee3e1021b153d505f
Command Line Args	SxS\Application" --user-data-dir="C:\Users\kbr\tmp\t1" --use-angle=d3d9 --flag-switches-begin --flag-switches-end "\chrome.exe"
Driver Information
Initialization time	81
In-process GPU	false
Sandboxed	false
GPU0	VENDOR = 0x1002, DEVICE= 0x6613
Optimus	false
AMD switchable	false
Desktop compositing	Aero Glass
Diagonal Monitor Size of \\.\DISPLAY1	24.0"
Driver vendor	Advanced Micro Devices, Inc.
Driver version	16.300.2511.1001
Driver date	8-11-2016
Pixel shader version	3.0
Vertex shader version	3.0
Max. MSAA samples	8
Machine model name	
Machine model version	
GL_VENDOR	Google Inc.
GL_RENDERER	ANGLE (AMD Radeon R7 200 Series Direct3D9Ex vs_3_0 ps_3_0)
GL_VERSION	OpenGL ES 2.0 (ANGLE 2.1.0.3fdec9194941)
GL_EXTENSIONS	GL_OES_element_index_uint GL_OES_packed_depth_stencil GL_OES_get_program_binary GL_OES_rgb8_rgba8 GL_EXT_texture_format_BGRA8888 GL_EXT_read_format_bgra GL_EXT_color_buffer_half_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_float GL_OES_texture_float_linear GL_EXT_texture_compression_dxt1 GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_OES_depth32 GL_EXT_texture_storage GL_OES_texture_npot GL_EXT_texture_filter_anisotropic GL_EXT_occlusion_query_boolean GL_NV_fence GL_EXT_robustness GL_EXT_blend_minmax GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_pack_reverse_row_order GL_OES_standard_derivatives GL_EXT_shader_texture_lod GL_EXT_frag_depth GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_unpack_subimage GL_NV_pack_subimage GL_OES_vertex_array_object GL_KHR_debug GL_CHROMIUM_bind_uniform_location GL_CHROMIUM_sync_query
Disabled Extensions	
Window system binding vendor	Google Inc. (adapter LUID: 000000000000aae0)
Window system binding version	1.4 (ANGLE 2.1.0.3fdec9194941)
Window system binding extensions	EGL_EXT_create_context_robustness EGL_ANGLE_d3d_share_handle_client_buffer EGL_ANGLE_surface_d3d_texture_2d_share_handle EGL_ANGLE_query_surface_pointer EGL_ANGLE_window_fixed_size EGL_NV_post_sub_buffer EGL_KHR_create_context EGL_EXT_device_query EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_renderbuffer_image EGL_KHR_get_all_proc_addresses EGL_ANGLE_flexible_surface_compatibility
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
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
Diagnostics
0
b3DAccelerationEnabled	true
b3DAccelerationExists	true
bAGPEnabled	true
bAGPExistenceValid	true
bAGPExists	true
bCanRenderWindow	true
bDDAccelerationEnabled	true
bDriverBeta	false
bDriverDebug	false
bDriverSigned	false
bDriverSignedValid	false
bNoHardware	false
dwBpp	32
dwDDIVersion	11
dwHeight	1200
dwRefreshRate	60
dwWHQLLevel	0
dwWidth	1920
iAdapter	0
lDriverSize	1525088
lMiniVddSize	0
szAGPStatusEnglish	Enabled
szAGPStatusLocalized	Enabled
szChipType	AMD Radeon Graphics Processor (0x6613)
szD3DStatusEnglish	Enabled
szD3DStatusLocalized	Enabled
szDACType	Internal DAC(400MHz)
szDDIVersionEnglish	11.1
szDDIVersionLocalized	11.1
szDDStatusEnglish	Enabled
szDDStatusLocalized	Enabled
szDXVAHDEnglish	Not Supported
szDXVAModes	ModeMPEG2_A ModeMPEG2_C ModeVC1_C ModeWMV9_C
szDescription	AMD Radeon R7 200 Series
szDeviceId	0x6613
szDeviceIdentifier	{D7B71EE2-2553-11CF-3176-8124BEC2C535}
szDeviceName	\\.\DISPLAY1
szDisplayMemoryEnglish	5867 MB
szDisplayMemoryLocalized	5867 MB
szDisplayModeEnglish	1920 x 1200 (32 bit) (60Hz)
szDisplayModeLocalized	1920 x 1200 (32 bit) (60Hz)
szDriverAssemblyVersion	16.300.2511.1001
szDriverAttributes	Final Retail
szDriverDateEnglish	8/11/2016 02:02:00
szDriverDateLocalized	8/11/2016 2:02:00 AM
szDriverLanguageEnglish	English
szDriverLanguageLocalized	English
szDriverModelEnglish	WDDM 1.3
szDriverModelLocalized	WDDM 1.3
szDriverName	aticfx64.dll,aticfx64.dll,aticfx64.dll,aticfx32,aticfx32,aticfx32,atiumd64.dll,atidxx64.dll,atidxx64.dll,atiumdag,atidxx32,atidxx32,atiumdva,atiumd6a.cap,atitmm64.dll
szDriverNodeStrongName	oem26.inf:cb0ae414e0edd08a:WB64A_ati2mtag_R501:16.300.2511.1001:pci\ven_1002&dev_6613
szDriverSignDate	
szDriverVersion	8.17.0010.1474
szKeyDeviceID	Enum\PCI\VEN_1002&DEV_6613&SUBSYS_048B1043&REV_00
szKeyDeviceKey	\Registry\Machine\System\CurrentControlSet\Control\Video\{54DC5C25-0A35-4AA2-9A70-82BB52CA8FE1}\0000
szManufacturer	Advanced Micro Devices, Inc.
szMiniVdd	n/a
szMiniVddDateEnglish	n/a
szMiniVddDateLocalized	n/a
szMonitorMaxRes	
szMonitorName	Generic PnP Monitor
szNotesEnglish	No problems found.
szNotesLocalized	No problems found.
szOverlayEnglish	Not Supported
szRankOfInstalledDriver	00DA2001
szRegHelpText	
szRevision	
szRevisionId	0x0000
szSubSysId	0x048B1043
szTestResultD3D7English	Not run
szTestResultD3D7Localized	Not run
szTestResultD3D8English	Not run
szTestResultD3D8Localized	Not run
szTestResultD3D9English	Not run
szTestResultD3D9Localized	Not run
szTestResultDDEnglish	Not run
szTestResultDDLocalized	Not run
szVdd	n/a
szVendorId	0x1002

Comment 5 by a...@figma.com, Aug 24 2016

It's not garbage.  You'll see the text repeated even though there is only one copy of the text.  Export and then pan the canvas.  The platform doesn't matter.  It happens on my Nvidia 950, a Surface Pro 4 with Intel, on Win 7/8.1/10.

Comment 6 by a...@figma.com, Aug 24 2016

We didn't test on AMD.  

Comment 7 by a...@figma.com, Aug 25 2016

Here's a capture of that file, after you scroll around after doing an export.  Sometimes the export has leftover renders in it, and sometimes not.  If you pan around the screen enough, then you'll see the leftover renders on-screen.  I just tested this with latest Canary.  The canvas is still inverted, but that's another bug that is supposedly isolated and fixed.
gpu.html
230 KB View Download
Capture.PNG
43.2 KB View Download

Comment 8 by a...@figma.com, Aug 25 2016

There should only be one of those text elements on the interactive view, not six.  It appears that it's not copying our renders to the correct portions of the screen with gl.copyTexSubImage2D.
when you say "supposedly isolated and fixed", were you referring to  issue 638313 ? Now I'm not sure if the bug was fixed, since we still see the problematic rendering. I might have to revisit that.

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

Cc: a...@figma.com evan....@gmail.com
Attached is a trace provided by Evan Wallace (now CC'd) which reproduces the problem when Chrome is run with --use-angle=d3d9. "mac-correct.png" shows the correct rendering; "windows-incorrect.png", the incorrect rendering. He said that the problem went away easily if the trace was cut down, so it might be difficult to reduce further.

Alec (the submitter) also pointed out the following:

"""
On Firefox, we were seeing errors on gl.clear(0) being called even though we never call that with 0.  On Chrome, there was a warning about taking the slow path, since a manual clear was needed.  Intel and Nvidia both exhibit the bug, but ANGLE gl/dx11 backend do not.  Might help a little.  We share a single depth stencil texture across all of our tiles.  Then copy final render results to one large FBO and then to the backbuffer.
"""

chrome-d3d9-bug-trace.zip
178 KB Download
mac-correct.png
28.0 KB View Download
windows-incorrect.png
26.7 KB View Download

Comment 11 by enne@chromium.org, Jan 25 2017

Components: -Internals>Graphics

Sign in to add a comment