Issue metadata
Sign in to add a comment
|
Get rid of unnecessary staging texture data on Windows in ANGLE |
||||||||||||||||||
Issue descriptionWhen we use ANGLE's D3D backend, because D3D doesn't allow us to create mipmap levels independently, so usually we need to keep a copy of pixel data on the CPU side, and whenever we modify a level, all previous uploaded data to the texture will be lost and we need to upload all levels' data again. This creates extra CPU memory pressure. For WebGL, there is nothing we can do but to ask developers to use TexStorage in WebGL2 as much as they can. However, in internal contexts, such as rasterizer, we know in advance our intention of a texture, so in theory we could almost always use TexStorage instead of TexImage to get rid of this staging data in CPU memory. Through profiling, here are some rough data from two machines (one laptop, one desktop workstation) on several popular site (see attached picture). To summarize, that's 50Mb to 120Mb CPU memory we could save in theory, plus the CPU time copying data to/from them.
,
Jun 7 2018
Some preliminary debugging shows that one source of these textures created through TexImage2D() are from Skia: allocate_and_populate_texture() in src/third_party/skia/src/gpu/gl/GrGLGpu.cpp Many calls to this function pass in mipLevelCount = 0, and there is a line in the function: useTexStorage &= mipLevelCount > 1; So we end up not using TexStorage. When I comment out this line, the websites I visited all render fine. Yet, I don't know if each use case will have the potential of creating more levels than just level 0 or not. Will need some help from Skia team to move forward.
,
Jun 7 2018
Greg is working on making it so that Skia never adds MIP levels to a texture created without them.
,
Jun 7 2018
+egdaniel@
,
Jun 7 2018
,
Jun 19 2018
My hack CL to measure the unnecessary staging texture copy mem size: https://chromium-review.googlesource.com/c/chromium/src/+/1105563 (I wrote something similar for original measurement, but accidentally I lost it, so today I re-wrote it to measure again)
,
Jan 10
Downgrading P2 issues unmodified for more than 6 months, which have no owner or component.
,
Jan 11
Available, but no owner or component? Please find a component, as no one will ever find this without one. |
|||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||
Comment 1 by zmo@chromium.org
, Jun 7 2018