Mapping BufferFormat,BufferUsage to texture type |
||||||||
Issue descriptionThe ui::Compositor/cc::LayerTreeHost objects in the mus clients need to know the correct <gfx::BufferFormat, gfx::BufferUsage> => texture-type mapping suitable for the system. Currently (in non-mash chrome), chrome-browser (which is the gpu-host) has access to this information, and passes on this information to chrome-renderer through command-line flags [1], and directly to its own ui::Compositor [2]. chrome-renderer reads this information from the command-line [3], and feeds it to cc [4]. In mash-chrome, the mus window-server (which is the gpu host) has access to this information. We could introduce something to the mojom::Gpu interface to feed the information back to mus-clients (like chrome-browser, and chrome-renderer). Although it's not clear if we can reliably do this early enough, because this information is used quite early on during the initialization phase in both browser and renderer. Or whether we will need to stick to sending this information through the command-line flags * [1] https://cs.chromium.org/chromium/src/content/browser/renderer_host/render_process_host_impl.cc?rcl=1481991563&l=1586 [2] https://cs.chromium.org/chromium/src/ui/compositor/compositor.cc?rcl=1481991563&l=187 [3] https://cs.chromium.org/chromium/src/content/renderer/render_thread_impl.cc?rcl=1481991563&l=794 [4] https://cs.chromium.org/chromium/src/content/renderer/render_thread_impl.cc?rcl=1481991563&l=1654 [*] mus-clients are launched by the service-manager. So if we want to send the information through command-line flags, then we will need some mechanism for mus-ws to tell service-manager to use the additional command-line flags. I am not sure such a mechanism exists yet.
,
Dec 19 2016
If it wasn't for MacOS and the TEXTURE_RECTANGLE requirement for IOSurfaces we could easily invent a new texture target that always had to be used with images. e.g. TEXTURE_EXTERNAL_CHROMIUM. and then translate that to the correct texture target on the gpu service side depending on the type of GLImage. That would be the ideal implementation. What if we TEXTURE_EXTERNAL_CHROMIUM and then simply say that on MacOS this target requires non-normalized texture coordinates? Then all this communication of texture just goes away.
,
Dec 19 2016
,
Dec 19 2016
While that does get rid of the plumbing, do you think that makes things easier or harder to explain and understand inside compositor/media code which is dealing with textures?
,
Dec 19 2016
I think the idea that a special texture target needs to be used with images is easy to understand as it matches OES_EGL_image_external but it might be hard to achieve as different texture target require different samplers (e.g. samplerExternalOES for EXTERNAL_OES).
,
Dec 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d8d46ad89248600597196924ec84c29aebd7a884 commit d8d46ad89248600597196924ec84c29aebd7a884 Author: sadrul <sadrul@chromium.org> Date: Tue Dec 20 01:21:54 2016 gpu: Move buffer format to target texture map into gpu host. Move the code that maps <BufferFormat,BufferUsage> to GL texture type into the gpu-host component, so that it can be used by both chrome and mus. BUG= 675431 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/2585653003 Cr-Commit-Position: refs/heads/master@{#439651} [modify] https://crrev.com/d8d46ad89248600597196924ec84c29aebd7a884/content/browser/compositor/gpu_process_transport_factory.cc [modify] https://crrev.com/d8d46ad89248600597196924ec84c29aebd7a884/content/browser/gpu/browser_gpu_memory_buffer_manager.cc [modify] https://crrev.com/d8d46ad89248600597196924ec84c29aebd7a884/content/browser/gpu/browser_gpu_memory_buffer_manager.h [modify] https://crrev.com/d8d46ad89248600597196924ec84c29aebd7a884/content/browser/renderer_host/render_process_host_impl.cc [modify] https://crrev.com/d8d46ad89248600597196924ec84c29aebd7a884/gpu/ipc/host/gpu_memory_buffer_support.cc [modify] https://crrev.com/d8d46ad89248600597196924ec84c29aebd7a884/gpu/ipc/host/gpu_memory_buffer_support.h [modify] https://crrev.com/d8d46ad89248600597196924ec84c29aebd7a884/ui/aura/mus/mus_context_factory.cc [modify] https://crrev.com/d8d46ad89248600597196924ec84c29aebd7a884/ui/compositor/compositor.cc
,
Dec 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7ac76b9328da7ec9531dab33484242fc3e3f980d commit 7ac76b9328da7ec9531dab33484242fc3e3f980d Author: sadrul <sadrul@chromium.org> Date: Tue Dec 20 01:55:20 2016 gpu: Simplify the mapping from BufferFormat to texture type. The texture type is always GL_TEXTURE_2D on non-ozone non-macos platforms. Make that more obvious when reading the code. BUG= 675431 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/2587823002 Cr-Commit-Position: refs/heads/master@{#439664} [modify] https://crrev.com/7ac76b9328da7ec9531dab33484242fc3e3f980d/gpu/ipc/host/gpu_memory_buffer_support.cc
,
Jan 21 2017
,
Jan 23 2017
If mus uses ozone, mus can ask it to ClientNativePixmapFactory, which is singleton in renderer and non-privileged process. To query it correctly in renderer, renderer needs to know if native GBM is enabled. https://codereview.chromium.org/2649553003/ lets renderer know if native GBM is enabled.
,
Feb 16 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 16 2018
vmiura's https://chromium-review.googlesource.com/849491 makes this sane, in that it is passed to the client as part of the gpu::Capabilities, and so the client can call gpu::GetBufferTextureTarget and get the right mapping. I'm going to call this fixed.
,
Feb 26 2018
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by sadrul@chromium.org
, Dec 18 2016