Open Bug 1690682 Opened 4 years ago Updated 4 years ago

Use client storage for uploading standalone textures from the WebRender texture cache

Categories

(Core :: Graphics: WebRender, task)

All
macOS
task

Tracking

()

People

(Reporter: mstange, Unassigned)

References

(Blocks 2 open bugs)

Details

Standalone textures in the texture cache should be easy to convert to client storage texture upload on macOS.

These texture are used for large images. They are rarely updated, and if they are updated, they are updated in their entirety. And the texture cache interface makes it easy to allocate a new texture object for them during the update.

Generally, these are large images. When using client storage for textures, I don't expect macOS to be able to use that memory directly, although it's possible. My expectations are based on Metal, where textures aren't allowed to use "shared" mode, see https://developer.apple.com/documentation/metal/setting_resource_storage_modes/choosing_a_resource_storage_mode_in_macos?language=objc .
So what we'll end up with is having 2 copies of the data: one in our client storage, and another in GPU memory. For large images this seems problematic. On the flipside, it may save a copy operation, since without client storage the driver may still use "managed" memory, but also copy from our data into its CPU copy...

Severity: -- → S3
Blocks: wr-mac

Right; we'll want to use "managed" mode for these textures, not "shared" mode. The intention isn't to prevent the copy to the GPU; the intention is to have the driver use DMA for the copy instead of burning CPU cycles (and blocking the renderer thread) during the copy.
The client storage docs say that we can choose between GL_STORAGE_CACHED_APPLE and GL_STORAGE_SHARED_APPLE, but these days, in practice, it's not clear whether "shared" is actually supported. We might just always be getting the "cached" behavior in practice.

You need to log in before you can comment on or make changes to this bug.