powervr-graphics / Native_SDK

C++ cross-platform 3D graphics SDK. Includes demos & helper code (resource loading etc.) to speed up development of Vulkan, OpenGL ES 2.0 & 3.x applications
https://docs.imgtec.com/sdk-documentation/html/introduction.html
MIT License
702 stars 197 forks source link

[BUG] the backbuffer format is always SRGB #42

Open zhaijialong opened 5 years ago

zhaijialong commented 5 years ago

Description

The emulator doesn't say it support EGL_KHR_gl_colorspace, but always create a r8g8b8a8_unorm_srgb format backbuffer in the underlying implementation.

It should use a linear format backbuffer as default if doesn't support EGL_KHR_gl_colorspace.

The better way is to expose the EGL_KHR_gl_colorspace egl extension, and let user to config it to determine whether to use a srgb backbuffer

EGLint eglSurfaceAttributes[3]
eglSurfaceAttributes[0] = EGL_GL_COLORSPACE_KHR;
eglSurfaceAttributes[1] = EGL_GL_COLORSPACE_SRGB_KHR;
eglSurfaceAttributes[2] = EGL_NONE;
egl::CreateWindowSurface(..., eglSurfaceAttributes)

Repro steps

Environment

Additional Info

And the emulator says it support EGL 1.5, EGL_KHR_gl_colorspace should be in EGL 1.5. But if I try

EGLint eglSurfaceAttributes[3]
eglSurfaceAttributes[0] = EGL_GL_COLORSPACE;
eglSurfaceAttributes[1] = EGL_GL_COLORSPACE_SRGB;
eglSurfaceAttributes[2] = EGL_NONE;
egl::CreateWindowSurface(..., eglSurfaceAttributes)

the egl::CreateWindowSurface will hang my process.

graptis commented 5 years ago

Hi @zhaijialong, Thanks for the report. I have forwarded this to the engineers responsible for PVRVFrame, but since this is a matter of Tools and not the actual codebase of the SDK, support will arguably be better in https://forums.imgtec.com/ which are for this purpose only. I would suggest opening an issue there (as well?). (We can still keep this issue open, but probably feedback will be sparse).

zhaijialong commented 5 years ago

https://forums.imgtec.com/t/issue-bug-the-backbuffer-format-is-always-srgb/2954