CC'ing Brandon (WebXR expert), Chris (colorspace expert), Vasiliy (Android graphics and SharedImage expert), Peng (Android graphics expert)Hi Rik,This behavior likely depends on a few variables:- How exactly the textures are being allocated (e.g. are they AHardwareBuffers wrapped into OpenGL textures?)
- How exactly the resulting texture is being put on screen (e.g. is that texture being displayed via OpenGL or is the AHardwareBuffer being scanned out directly?)
- Whether Vulkan is being used by the browser for compositing (although I suspect this won't affect the handling of these OpenXR-provided textures)
I don't know definitive answers to any of these, but hope that the CC'd experts can help answer them and your questions.Note: I don't see any real references to GL_FRAMEBUFFER_SRGB_EXT in Chromium:
All of the references are in autogenerated code, or third-party libraries like Mesa which aren't actually used in Chromium's graphics stack. I don't think any of Chromium's internal code, including Skia, is enabling or disabling this capability bit.One more wrinkle: we are working on moving Chromium on Android to be hosted on top of ANGLE, and that will soon introduce another interposition layer. However, this one will also confer some significant advantages, like being able to transparently re-host the WebGL implementation on top of ANGLE's Vulkan backend.
Thanks for the reply Ken!On Thu, Mar 17, 2022 at 6:25 PM Ken Russell <k...@chromium.org> wrote:CC'ing Brandon (WebXR expert), Chris (colorspace expert), Vasiliy (Android graphics and SharedImage expert), Peng (Android graphics expert)Hi Rik,This behavior likely depends on a few variables:- How exactly the textures are being allocated (e.g. are they AHardwareBuffers wrapped into OpenGL textures?)They are regular texture that come from a swapchain (= they were allocated in the system compositor and transferred to the browser)- How exactly the resulting texture is being put on screen (e.g. is that texture being displayed via OpenGL or is the AHardwareBuffer being scanned out directly?)When the texture is released at the end of the Raf call, it is picked up by the system compositor which display it on the headset (after doing things like timewarp and color correction)- Whether Vulkan is being used by the browser for compositing (although I suspect this won't affect the handling of these OpenXR-provided textures)No. The browser does use that texture to draw to screen.
Thanks for the reply Ken!On Thu, Mar 17, 2022 at 6:25 PM Ken Russell <k...@chromium.org> wrote:CC'ing Brandon (WebXR expert), Chris (colorspace expert), Vasiliy (Android graphics and SharedImage expert), Peng (Android graphics expert)Hi Rik,This behavior likely depends on a few variables:- How exactly the textures are being allocated (e.g. are they AHardwareBuffers wrapped into OpenGL textures?)They are regular texture that come from a swapchain (= they were allocated in the system compositor and transferred to the browser)
- How exactly the resulting texture is being put on screen (e.g. is that texture being displayed via OpenGL or is the AHardwareBuffer being scanned out directly?)When the texture is released at the end of the Raf call, it is picked up by the system compositor which display it on the headset (after doing things like timewarp and color correction)- Whether Vulkan is being used by the browser for compositing (although I suspect this won't affect the handling of these OpenXR-provided textures)
No. The browser does not use that texture to draw to screen.
I don't know definitive answers to any of these, but hope that the CC'd experts can help answer them and your questions.Note: I don't see any real references to GL_FRAMEBUFFER_SRGB_EXT in Chromium:True. I saw that there were checks for EXT_framebuffer_sRGB which is the extension that enables this flag.All of the references are in autogenerated code, or third-party libraries like Mesa which aren't actually used in Chromium's graphics stack. I don't think any of Chromium's internal code, including Skia, is enabling or disabling this capability bit.One more wrinkle: we are working on moving Chromium on Android to be hosted on top of ANGLE, and that will soon introduce another interposition layer. However, this one will also confer some significant advantages, like being able to transparently re-host the WebGL implementation on top of ANGLE's Vulkan backend.That would be very cool! I assume ANGLE doesn't support this flag so we'd have to add it.
FWIW I really don't like this change that OpenXR is pushing on us and I'm trying to make our compositor consume RGBA textures as if they were sRGBA like before.
It seems that other implementations would run into the same issue. Maybe they didn't notice that the color on screen and the headset are different?
Unfortunately I don't know much about how WebXR really works, but what part of chrome draws to those textures? From chrome/gpu perspective, the display compositor should be able to draw to any (reasonable) color space requested.