From 7f2d86b31d5aca1b6567cedd9c461d800f1f3ac5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 20 Jul 2016 18:41:21 +0200 Subject: [PATCH] [Coverity] Fix some more uninitialised values/members --- renderdoc/driver/d3d11/d3d11_device.h | 2 +- renderdoc/driver/d3d11/d3d11_replay.cpp | 17 ++++ renderdoc/driver/d3d12/d3d12_command_list.h | 2 +- renderdoc/driver/d3d12/d3d12_command_queue.h | 2 +- renderdoc/driver/d3d12/d3d12_device.h | 4 +- renderdoc/driver/d3d12/d3d12_resources.h | 6 +- renderdoc/driver/gl/gl_driver.h | 2 + renderdoc/driver/gl/gl_hooks_linux.cpp | 36 +++---- renderdoc/driver/gl/gl_hooks_win32.cpp | 93 +++++++++++++++++++ renderdoc/driver/gl/gl_resources.h | 2 + .../driver/gl/wrappers/gl_texture_funcs.cpp | 10 +- renderdoc/driver/vulkan/vk_core.cpp | 13 +++ renderdoc/driver/vulkan/vk_core.h | 4 + renderdoc/driver/vulkan/vk_replay.cpp | 14 ++- renderdoc/driver/vulkan/vk_state.cpp | 2 + 15 files changed, 179 insertions(+), 30 deletions(-) diff --git a/renderdoc/driver/d3d11/d3d11_device.h b/renderdoc/driver/d3d11/d3d11_device.h index 9f63606d9..a3248fd8b 100644 --- a/renderdoc/driver/d3d11/d3d11_device.h +++ b/renderdoc/driver/d3d11/d3d11_device.h @@ -83,7 +83,7 @@ struct WrappedID3D11Debug : public ID3D11Debug WrappedID3D11Device *m_pDevice; ID3D11Debug *m_pDebug; - WrappedID3D11Debug() {} + WrappedID3D11Debug() : m_pDevice(NULL), m_pDebug(NULL) {} ////////////////////////////// // implement IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index b69fd0620..d48355ca1 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -290,6 +290,23 @@ FetchTexture D3D11Replay::GetTexture(ResourceId id) return tex; } + RDCERR("Unrecognised/unknown texture %llu", id); + + tex.name = "Unrecognised/unknown texture"; + tex.customName = true; + tex.byteSize = 0; + tex.dimension = 2; + tex.resType = eResType_Texture2D; + tex.width = 1; + tex.height = 1; + tex.depth = 1; + tex.cubemap = false; + tex.mips = 1; + tex.arraysize = 1; + tex.numSubresources = 1; + tex.msQual = 0; + tex.msSamp = 1; + return tex; } diff --git a/renderdoc/driver/d3d12/d3d12_command_list.h b/renderdoc/driver/d3d12/d3d12_command_list.h index bb87e5e48..f234df095 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list.h +++ b/renderdoc/driver/d3d12/d3d12_command_list.h @@ -36,7 +36,7 @@ struct DummyID3D12DebugCommandList : public ID3D12DebugCommandList WrappedID3D12GraphicsCommandList *m_pList; ID3D12DebugCommandList *m_pReal; - DummyID3D12DebugCommandList() {} + DummyID3D12DebugCommandList() : m_pList(NULL), m_pReal(NULL) {} ////////////////////////////// // implement IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject) diff --git a/renderdoc/driver/d3d12/d3d12_command_queue.h b/renderdoc/driver/d3d12/d3d12_command_queue.h index 11d691b0c..cad589aad 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue.h +++ b/renderdoc/driver/d3d12/d3d12_command_queue.h @@ -37,7 +37,7 @@ struct DummyID3D12DebugCommandQueue : public ID3D12DebugCommandQueue WrappedID3D12CommandQueue *m_pQueue; ID3D12DebugCommandQueue *m_pReal; - DummyID3D12DebugCommandQueue() {} + DummyID3D12DebugCommandQueue() : m_pQueue(NULL), m_pReal(NULL) {} ////////////////////////////// // implement IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject) diff --git a/renderdoc/driver/d3d12/d3d12_device.h b/renderdoc/driver/d3d12/d3d12_device.h index 3b0a2a892..2ab65a497 100644 --- a/renderdoc/driver/d3d12/d3d12_device.h +++ b/renderdoc/driver/d3d12/d3d12_device.h @@ -161,7 +161,7 @@ struct WrappedID3D12DebugDevice : public ID3D12DebugDevice WrappedID3D12Device *m_pDevice; ID3D12DebugDevice *m_pDebug; - WrappedID3D12DebugDevice() {} + WrappedID3D12DebugDevice() : m_pDevice(NULL), m_pDebug(NULL) {} ////////////////////////////// // implement IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); @@ -194,7 +194,7 @@ struct DummyID3D12DebugDevice : public ID3D12DebugDevice { WrappedID3D12Device *m_pDevice; - DummyID3D12DebugDevice() {} + DummyID3D12DebugDevice() : m_pDevice(NULL) {} ////////////////////////////// // implement IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); diff --git a/renderdoc/driver/d3d12/d3d12_resources.h b/renderdoc/driver/d3d12/d3d12_resources.h index 4353dbdb4..6b4208fcc 100644 --- a/renderdoc/driver/d3d12/d3d12_resources.h +++ b/renderdoc/driver/d3d12/d3d12_resources.h @@ -32,7 +32,11 @@ class TrackedResource { public: - TrackedResource() { m_ID = ResourceIDGen::GetNewUniqueID(); } + TrackedResource() + { + m_ID = ResourceIDGen::GetNewUniqueID(); + m_pRecord = NULL; + } ResourceId GetResourceID() { return m_ID; } D3D12ResourceRecord *GetResourceRecord() { return m_pRecord; } void SetResourceRecord(D3D12ResourceRecord *record) { m_pRecord = record; } diff --git a/renderdoc/driver/gl/gl_driver.h b/renderdoc/driver/gl/gl_driver.h index 468295124..d1917fe6b 100644 --- a/renderdoc/driver/gl/gl_driver.h +++ b/renderdoc/driver/gl/gl_driver.h @@ -351,6 +351,8 @@ private: { ContextData() { + ctx = NULL; + built = ready = false; attribsCreate = false; version = 0; diff --git a/renderdoc/driver/gl/gl_hooks_linux.cpp b/renderdoc/driver/gl/gl_hooks_linux.cpp index fc7e2bc62..2bae2ab39 100644 --- a/renderdoc/driver/gl/gl_hooks_linux.cpp +++ b/renderdoc/driver/gl/gl_hooks_linux.cpp @@ -393,6 +393,8 @@ public: RDCEraseEl(GL); + m_HasHooks = false; + m_GLDriver = NULL; m_EnabledHooks = true; @@ -542,7 +544,7 @@ DefineGLExtensionHooks(); for I in `seq 1 $N`; do echo -n "t$I"; if [ $I -ne $N ]; then echo -n ", "; fi; done; echo "); \\"; - echo -en "\tCONCAT(function, _hooktype) CONCAT(unsupported_real_,function);"; + echo -en "\tCONCAT(function, _hooktype) CONCAT(unsupported_real_,function) = NULL;"; echo -en "\tret CONCAT(function,_renderdoc_hooked)("; for I in `seq 1 $N`; do echo -n "t$I p$I"; if [ $I -ne $N ]; then echo -n ", "; fi; @@ -565,7 +567,7 @@ DefineGLExtensionHooks(); #undef HookWrapper0 #define HookWrapper0(ret, function) \ typedef ret (*CONCAT(function, _hooktype))(); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)() \ { \ static bool hit = false; \ @@ -580,7 +582,7 @@ DefineGLExtensionHooks(); #undef HookWrapper1 #define HookWrapper1(ret, function, t1, p1) \ typedef ret (*CONCAT(function, _hooktype))(t1); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1) \ { \ static bool hit = false; \ @@ -595,7 +597,7 @@ DefineGLExtensionHooks(); #undef HookWrapper2 #define HookWrapper2(ret, function, t1, p1, t2, p2) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2) \ { \ static bool hit = false; \ @@ -610,7 +612,7 @@ DefineGLExtensionHooks(); #undef HookWrapper3 #define HookWrapper3(ret, function, t1, p1, t2, p2, t3, p3) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3) \ { \ static bool hit = false; \ @@ -625,7 +627,7 @@ DefineGLExtensionHooks(); #undef HookWrapper4 #define HookWrapper4(ret, function, t1, p1, t2, p2, t3, p3, t4, p4) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4) \ { \ static bool hit = false; \ @@ -640,7 +642,7 @@ DefineGLExtensionHooks(); #undef HookWrapper5 #define HookWrapper5(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \ { \ static bool hit = false; \ @@ -655,7 +657,7 @@ DefineGLExtensionHooks(); #undef HookWrapper6 #define HookWrapper6(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \ { \ static bool hit = false; \ @@ -670,7 +672,7 @@ DefineGLExtensionHooks(); #undef HookWrapper7 #define HookWrapper7(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \ { \ static bool hit = false; \ @@ -685,7 +687,7 @@ DefineGLExtensionHooks(); #undef HookWrapper8 #define HookWrapper8(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7, t8); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \ { \ static bool hit = false; \ @@ -701,7 +703,7 @@ DefineGLExtensionHooks(); #define HookWrapper9(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ p8, t9, p9) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7, t8, t9); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, \ t9 p9) \ { \ @@ -718,7 +720,7 @@ DefineGLExtensionHooks(); #define HookWrapper10(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ p8, t9, p9, t10, p10) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, \ t9 p9, t10 p10) \ { \ @@ -735,7 +737,7 @@ DefineGLExtensionHooks(); #define HookWrapper11(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ p8, t9, p9, t10, p10, t11, p11) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, \ t9 p9, t10 p10, t11 p11) \ { \ @@ -752,7 +754,7 @@ DefineGLExtensionHooks(); #define HookWrapper12(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ p8, t9, p9, t10, p10, t11, p11, t12, p12) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, \ t9 p9, t10 p10, t11 p11, t12 p12) \ { \ @@ -770,7 +772,7 @@ DefineGLExtensionHooks(); p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, \ t13); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, \ t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \ { \ @@ -789,7 +791,7 @@ DefineGLExtensionHooks(); p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, \ t13, t14); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, \ t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \ { \ @@ -808,7 +810,7 @@ DefineGLExtensionHooks(); p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15) \ typedef ret (*CONCAT(function, _hooktype))(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, \ t13, t14, t15); \ - CONCAT(function, _hooktype) CONCAT(unsupported_real_, function); \ + CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \ ret CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, \ t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, \ t15 p15) \ diff --git a/renderdoc/driver/gl/gl_hooks_win32.cpp b/renderdoc/driver/gl/gl_hooks_win32.cpp index 8f38be09b..17f6702f1 100644 --- a/renderdoc/driver/gl/gl_hooks_win32.cpp +++ b/renderdoc/driver/gl/gl_hooks_win32.cpp @@ -318,12 +318,16 @@ public: m_GLDriver = NULL; + m_HasHooks = false; + m_HaveContextCreation = false; m_EnabledHooks = true; m_PopulatedHooks = false; m_CreatingContext = false; + + SetUnsupportedFunctionPointersToNULL(); } ~OpenGLHook() { delete m_GLDriver; } bool CreateHooks(const char *libName) @@ -1206,6 +1210,95 @@ private: } DefineUnsupportedDummies(); + + /* + in bash: + + function HookWrapper() + { + N=$1; + echo "#undef HookWrapper$N"; + echo -n "#define HookWrapper$N(ret, function"; + for I in `seq 1 $N`; do echo -n ", t$I, p$I"; done; + echo ") \\"; + + echo -e "\tCONCAT(unsupported_real_,function) = NULL;"; + } + + for I in `seq 0 15`; do HookWrapper $I; echo; done + */ + void SetUnsupportedFunctionPointersToNULL() + { +#undef HookWrapper0 +#define HookWrapper0(ret, function) CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper1 +#define HookWrapper1(ret, function, t1, p1) CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper2 +#define HookWrapper2(ret, function, t1, p1, t2, p2) CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper3 +#define HookWrapper3(ret, function, t1, p1, t2, p2, t3, p3) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper4 +#define HookWrapper4(ret, function, t1, p1, t2, p2, t3, p3, t4, p4) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper5 +#define HookWrapper5(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper6 +#define HookWrapper6(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper7 +#define HookWrapper7(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper8 +#define HookWrapper8(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper9 +#define HookWrapper9(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ + p8, t9, p9) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper10 +#define HookWrapper10(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ + p8, t9, p9, t10, p10) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper11 +#define HookWrapper11(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ + p8, t9, p9, t10, p10, t11, p11) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper12 +#define HookWrapper12(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ + p8, t9, p9, t10, p10, t11, p11, t12, p12) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper13 +#define HookWrapper13(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ + p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper14 +#define HookWrapper14(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ + p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14) \ + CONCAT(unsupported_real_, function) = NULL; + +#undef HookWrapper15 +#define HookWrapper15(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, \ + p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15) \ + CONCAT(unsupported_real_, function) = NULL; + + DefineUnsupportedDummies(); + } }; OpenGLHook OpenGLHook::glhooks; diff --git a/renderdoc/driver/gl/gl_resources.h b/renderdoc/driver/gl/gl_resources.h index 77996ab59..2fa0c11d0 100644 --- a/renderdoc/driver/gl/gl_resources.h +++ b/renderdoc/driver/gl/gl_resources.h @@ -93,11 +93,13 @@ struct GLResource GLResource() { Namespace = eResUnknown; + Context = NULL; name = ~0U; } GLResource(NullInitialiser) { Namespace = eResUnknown; + Context = NULL; name = ~0U; } GLResource(void *ctx, GLNamespace n, GLuint i) diff --git a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp index 4ec5c120e..96b26b119 100644 --- a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp @@ -3534,7 +3534,7 @@ bool WrappedOpenGL::Serialise_glTextureStorage1DEXT(GLuint texture, GLenum targe if(m_State == READING) { - GLenum dummy; + GLenum dummy = eGL_NONE; bool emulated = EmulateLuminanceFormat(m_Real, GetResourceManager()->GetLiveResource(id).name, Target, Format, dummy); @@ -3652,7 +3652,7 @@ bool WrappedOpenGL::Serialise_glTextureStorage2DEXT(GLuint texture, GLenum targe if(m_State == READING) { - GLenum dummy; + GLenum dummy = eGL_NONE; bool emulated = EmulateLuminanceFormat(m_Real, GetResourceManager()->GetLiveResource(id).name, Target, Format, dummy); @@ -3774,7 +3774,7 @@ bool WrappedOpenGL::Serialise_glTextureStorage3DEXT(GLuint texture, GLenum targe if(m_State == READING) { - GLenum dummy; + GLenum dummy = eGL_NONE; bool emulated = EmulateLuminanceFormat(m_Real, GetResourceManager()->GetLiveResource(id).name, Target, Format, dummy); @@ -3899,7 +3899,7 @@ bool WrappedOpenGL::Serialise_glTextureStorage2DMultisampleEXT(GLuint texture, G if(m_State == READING) { - GLenum dummy; + GLenum dummy = eGL_NONE; bool emulated = EmulateLuminanceFormat(m_Real, GetResourceManager()->GetLiveResource(id).name, Target, Format, dummy); @@ -4063,7 +4063,7 @@ bool WrappedOpenGL::Serialise_glTextureStorage3DMultisampleEXT(GLuint texture, G if(m_State == READING) { - GLenum dummy; + GLenum dummy = eGL_NONE; bool emulated = EmulateLuminanceFormat(m_Real, GetResourceManager()->GetLiveResource(id).name, Target, Format, dummy); diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 3be42476c..d76fdbb1e 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -284,6 +284,9 @@ WrappedVulkan::WrappedVulkan(const char *logFilename) : m_RenderState(&m_Creatio m_DrawcallCallback = NULL; + m_CurChunkOffset = 0; + m_AddedDrawcall = false; + m_LastCmdBufferID = ResourceId(); m_DrawcallStack.push_back(&m_ParentDrawcall); @@ -292,9 +295,19 @@ WrappedVulkan::WrappedVulkan(const char *logFilename) : m_RenderState(&m_Creatio m_ResourceManager = new VulkanResourceManager(m_State, m_pSerialiser, this); + m_DebugManager = NULL; + m_pSerialiser->SetUserData(m_ResourceManager); m_RenderState.m_ResourceManager = GetResourceManager(); + m_Instance = VK_NULL_HANDLE; + m_PhysicalDevice = VK_NULL_HANDLE; + m_Device = VK_NULL_HANDLE; + m_Queue = VK_NULL_HANDLE; + m_QueueFamilyIdx = 0; + m_SupportedQueueFamily = 0; + m_DbgMsgCallback = NULL; + m_HeaderChunk = NULL; if(!RenderDoc::Inst().IsReplayApp()) diff --git a/renderdoc/driver/vulkan/vk_core.h b/renderdoc/driver/vulkan/vk_core.h index de1505f23..8f5227476 100644 --- a/renderdoc/driver/vulkan/vk_core.h +++ b/renderdoc/driver/vulkan/vk_core.h @@ -260,8 +260,12 @@ private: { PhysicalDeviceData() : readbackMemIndex(0), uploadMemIndex(0), GPULocalMemIndex(0) { + fakeMemProps = NULL; + memIdxMap = NULL; RDCEraseEl(features); + RDCEraseEl(props); RDCEraseEl(memProps); + RDCEraseEl(fmtprops); } uint32_t GetMemoryIndex(uint32_t resourceRequiredBitmask, uint32_t allocRequiredProps, diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index a236047e2..57bb2560b 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -32,8 +32,7 @@ #include "vk_debug.h" #include "vk_resources.h" -VulkanReplay::OutputWindow::OutputWindow() - : wnd(NULL_WND_HANDLE), width(0), height(0), dsimg(VK_NULL_HANDLE), dsmem(VK_NULL_HANDLE) +VulkanReplay::OutputWindow::OutputWindow() : wnd(NULL_WND_HANDLE), width(0), height(0) { surface = VK_NULL_HANDLE; swap = VK_NULL_HANDLE; @@ -47,12 +46,23 @@ VulkanReplay::OutputWindow::OutputWindow() failures = recreatePause = 0; bb = VK_NULL_HANDLE; + bbmem = VK_NULL_HANDLE; bbview = VK_NULL_HANDLE; + + dsimg = VK_NULL_HANDLE; + dsmem = VK_NULL_HANDLE; + dsview = VK_NULL_HANDLE; + fb = VK_NULL_HANDLE; fbdepth = VK_NULL_HANDLE; rp = VK_NULL_HANDLE; rpdepth = VK_NULL_HANDLE; + numImgs = 0; + curidx = 0; + + m_ResourceManager = NULL; + VkImageMemoryBarrier t = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL, diff --git a/renderdoc/driver/vulkan/vk_state.cpp b/renderdoc/driver/vulkan/vk_state.cpp index 206a36f02..90c87c392 100644 --- a/renderdoc/driver/vulkan/vk_state.cpp +++ b/renderdoc/driver/vulkan/vk_state.cpp @@ -43,6 +43,8 @@ VulkanRenderState::VulkanRenderState(VulkanCreationInfo *createInfo) : m_Creatio RDCEraseEl(back); RDCEraseEl(pushconsts); + m_ResourceManager = NULL; + renderPass = ResourceId(); subpass = 0;