From 579386dddb480dcc7ac08c1f20895358d43db3ea Mon Sep 17 00:00:00 2001 From: Jimmy Lee Date: Fri, 19 Jan 2018 12:46:25 -0800 Subject: [PATCH] gearvr crash fix and mip level fix for gearvr swapchain --- renderdoc/driver/gl/gl_driver.cpp | 2 +- renderdoc/driver/gl/gl_hooks_vrapi.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index 9c0a8ef07..b9852697c 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -1472,7 +1472,7 @@ void WrappedOpenGL::CreateVRAPITextureSwapChain(GLuint tex, GLenum textureType, } gl_CurChunk = GLChunk::glTexParameteri; - Common_glTextureParameteriEXT(record, textureType, eGL_TEXTURE_MAX_LEVEL, levels); + Common_glTextureParameteriEXT(record, textureType, eGL_TEXTURE_MAX_LEVEL, levels - 1); } else { diff --git a/renderdoc/driver/gl/gl_hooks_vrapi.cpp b/renderdoc/driver/gl/gl_hooks_vrapi.cpp index 5abcaedb8..94e7d9ed5 100644 --- a/renderdoc/driver/gl/gl_hooks_vrapi.cpp +++ b/renderdoc/driver/gl/gl_hooks_vrapi.cpp @@ -189,8 +189,6 @@ __attribute__((visibility("default"))) ovrTextureSwapChain *vrapi_CreateTextureS vrapi_hooks.SetupHooks(); } - gl_CurChunk = GLChunk::vrapi_CreateTextureSwapChain2; - ovrTextureSwapChain *texture_swapchain = vrapi_hooks.vrapi_CreateTextureSwapChain2_real( type, format, width, height, levels, bufferCount); @@ -206,6 +204,7 @@ __attribute__((visibility("default"))) ovrTextureSwapChain *vrapi_CreateTextureS GLenum internalformat = GetInternalFormat(format); GLenum textureType = GetTextureType(type); + gl_CurChunk = GLChunk::vrapi_CreateTextureSwapChain2; m_GLDriver->CreateVRAPITextureSwapChain(tex, textureType, internalformat, width, height, levels); } @@ -224,8 +223,6 @@ __attribute__((visibility("default"))) ovrTextureSwapChain *vrapi_CreateTextureS vrapi_hooks.SetupHooks(); } - gl_CurChunk = GLChunk::vrapi_CreateTextureSwapChain; - ovrTextureSwapChain *texture_swapchain = vrapi_hooks.vrapi_CreateTextureSwapChain_real(type, format, width, height, levels, buffered); @@ -241,6 +238,7 @@ __attribute__((visibility("default"))) ovrTextureSwapChain *vrapi_CreateTextureS GLenum internalformat = GetInternalFormat(format); GLenum textureType = GetTextureType(type); + gl_CurChunk = GLChunk::vrapi_CreateTextureSwapChain; m_GLDriver->CreateVRAPITextureSwapChain(tex, textureType, internalformat, width, height, levels); }