Speculative support for 10-bit backbuffers on GL

This commit is contained in:
baldurk
2020-09-14 15:30:49 +01:00
parent ce1cfe5330
commit 8615c5fc14
2 changed files with 17 additions and 1 deletions
+8
View File
@@ -328,6 +328,14 @@ HOOK_EXPORT EGLContext EGLAPIENTRY eglCreateContext_renderdoc_hooked(EGLDisplay
// We will set isSRGB when we see the surface.
init.isSRGB = 0;
EGLint rgbSize[3] = {};
EGL.GetConfigAttrib(display, config, EGL_RED_SIZE, &rgbSize[0]);
EGL.GetConfigAttrib(display, config, EGL_GREEN_SIZE, &rgbSize[1]);
EGL.GetConfigAttrib(display, config, EGL_BLUE_SIZE, &rgbSize[2]);
if(rgbSize[0] == rgbSize[1] && rgbSize[1] == rgbSize[2] && rgbSize[2] == 10)
init.colorBits = 10;
GLWindowingData data;
data.egl_dpy = display;
data.wnd = 0;
+9 -1
View File
@@ -741,7 +741,11 @@ void WrappedOpenGL::CreateReplayBackbuffer(const GLInitParams &params, ResourceI
GLenum colfmt = eGL_RGBA8;
if(params.colorBits == 32)
if(params.colorBits == 64)
{
colfmt = eGL_RGBA16F;
}
else if(params.colorBits == 32)
{
colfmt = params.isSRGB ? eGL_SRGB8_ALPHA8 : eGL_RGBA8;
}
@@ -759,6 +763,10 @@ void WrappedOpenGL::CreateReplayBackbuffer(const GLInitParams &params, ResourceI
else
colfmt = eGL_RGB8;
}
else if(params.colorBits == 10)
{
colfmt = eGL_RGB10_A2;
}
else
{
RDCERR("Unexpected # colour bits: %d", params.colorBits);