From 7f63721a59db0b95e51e0700924c73b88498d6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 29 Aug 2018 18:12:21 -0700 Subject: [PATCH] Cleanup. --- scripts/bgfx.natvis | 6 ++ src/renderer_d3d11.cpp | 158 +++++++++++++++++++++-------------------- src/renderer_d3d12.cpp | 46 ++++++------ src/renderer_d3d9.cpp | 20 +++--- src/renderer_vk.cpp | 36 +++++----- 5 files changed, 137 insertions(+), 129 deletions(-) diff --git a/scripts/bgfx.natvis b/scripts/bgfx.natvis index 19051bb23..b82280af2 100644 --- a/scripts/bgfx.natvis +++ b/scripts/bgfx.natvis @@ -120,4 +120,10 @@ (bgfx::EncoderImpl *)this + + + + (DebugDrawEncoderImpl *)this + + diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index e291fa738..6bfc54bb0 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -641,10 +641,10 @@ namespace bgfx { namespace d3d11 struct RendererContextD3D11 : public RendererContextI { RendererContextD3D11() - : m_d3d9dll(NULL) - , m_d3d11dll(NULL) - , m_renderdocdll(NULL) - , m_agsdll(NULL) + : m_d3d9Dll(NULL) + , m_d3d11Dll(NULL) + , m_renderDocDll(NULL) + , m_agsDll(NULL) , m_ags(NULL) , m_featureLevel(D3D_FEATURE_LEVEL(0) ) , m_swapChain(NULL) @@ -696,7 +696,7 @@ namespace bgfx { namespace d3d11 if (_init.debug || _init.profile) { - m_renderdocdll = loadRenderDoc(); + m_renderDocDll = loadRenderDoc(); } m_fbh.idx = kInvalidHandle; @@ -704,25 +704,25 @@ namespace bgfx { namespace d3d11 bx::memSet(&m_resolution, 0, sizeof(m_resolution) ); m_ags = NULL; - m_agsdll = bx::dlopen( + m_agsDll = bx::dlopen( #if BX_ARCH_32BIT "amd_ags_x86.dll" #else "amd_ags_x64.dll" #endif // BX_ARCH_32BIT ); - if (NULL != m_agsdll) + if (NULL != m_agsDll) { - agsInit = (PFN_AGS_INIT )bx::dlsym(m_agsdll, "agsInit"); - agsDeInit = (PFN_AGS_DEINIT)bx::dlsym(m_agsdll, "agsDeInit"); - agsGetCrossfireGPUCount = (PFN_AGS_GET_CROSSFIRE_GPU_COUNT )bx::dlsym(m_agsdll, "agsGetCrossfireGPUCount"); - agsGetTotalGPUCount = (PFN_AGS_GET_TOTAL_GPU_COUNT )bx::dlsym(m_agsdll, "agsGetTotalGPUCount"); - agsGetGPUMemorySize = (PFN_AGS_GET_GPU_MEMORY_SIZE )bx::dlsym(m_agsdll, "agsGetGPUMemorySize"); - agsGetDriverVersionInfo = (PFN_AGS_GET_DRIVER_VERSION_INFO )bx::dlsym(m_agsdll, "agsGetDriverVersionInfo"); - agsDriverExtensions_Init = (PFN_AGS_DRIVER_EXTENSIONS_INIT )bx::dlsym(m_agsdll, "agsDriverExtensions_Init"); - agsDriverExtensions_DeInit = (PFN_AGS_DRIVER_EXTENSIONS_DEINIT)bx::dlsym(m_agsdll, "agsDriverExtensions_DeInit"); - agsDriverExtensions_MultiDrawInstancedIndirect = (PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INSTANCED_INDIRECT )bx::dlsym(m_agsdll, "agsDriverExtensions_MultiDrawInstancedIndirect"); - agsDriverExtensions_MultiDrawIndexedInstancedIndirect = (PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INDEXED_INSTANCED_INDIRECT)bx::dlsym(m_agsdll, "agsDriverExtensions_MultiDrawIndexedInstancedIndirect"); + agsInit = (PFN_AGS_INIT )bx::dlsym(m_agsDll, "agsInit"); + agsDeInit = (PFN_AGS_DEINIT)bx::dlsym(m_agsDll, "agsDeInit"); + agsGetCrossfireGPUCount = (PFN_AGS_GET_CROSSFIRE_GPU_COUNT )bx::dlsym(m_agsDll, "agsGetCrossfireGPUCount"); + agsGetTotalGPUCount = (PFN_AGS_GET_TOTAL_GPU_COUNT )bx::dlsym(m_agsDll, "agsGetTotalGPUCount"); + agsGetGPUMemorySize = (PFN_AGS_GET_GPU_MEMORY_SIZE )bx::dlsym(m_agsDll, "agsGetGPUMemorySize"); + agsGetDriverVersionInfo = (PFN_AGS_GET_DRIVER_VERSION_INFO )bx::dlsym(m_agsDll, "agsGetDriverVersionInfo"); + agsDriverExtensions_Init = (PFN_AGS_DRIVER_EXTENSIONS_INIT )bx::dlsym(m_agsDll, "agsDriverExtensions_Init"); + agsDriverExtensions_DeInit = (PFN_AGS_DRIVER_EXTENSIONS_DEINIT)bx::dlsym(m_agsDll, "agsDriverExtensions_DeInit"); + agsDriverExtensions_MultiDrawInstancedIndirect = (PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INSTANCED_INDIRECT )bx::dlsym(m_agsDll, "agsDriverExtensions_MultiDrawInstancedIndirect"); + agsDriverExtensions_MultiDrawIndexedInstancedIndirect = (PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INDEXED_INSTANCED_INDIRECT)bx::dlsym(m_agsDll, "agsDriverExtensions_MultiDrawIndexedInstancedIndirect"); bool agsSupported = true && NULL != agsInit @@ -778,17 +778,17 @@ namespace bgfx { namespace d3d11 m_ags = NULL; } - bx::dlclose(m_agsdll); - m_agsdll = NULL; + bx::dlclose(m_agsDll); + m_agsDll = NULL; } } m_nvapi.init(); #if USE_D3D11_DYNAMIC_LIB - m_d3d11dll = bx::dlopen("d3d11.dll"); + m_d3d11Dll = bx::dlopen("d3d11.dll"); - if (NULL == m_d3d11dll) + if (NULL == m_d3d11Dll) { BX_TRACE("Init error: Failed to load d3d11.dll."); goto error; @@ -796,18 +796,18 @@ namespace bgfx { namespace d3d11 errorState = ErrorState::LoadedD3D11; - m_d3d9dll = NULL; + m_d3d9Dll = NULL; if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) { // D3D11_1.h has ID3DUserDefinedAnnotation // http://msdn.microsoft.com/en-us/library/windows/desktop/hh446881%28v=vs.85%29.aspx - m_d3d9dll = bx::dlopen("d3d9.dll"); - if (NULL != m_d3d9dll) + m_d3d9Dll = bx::dlopen("d3d9.dll"); + if (NULL != m_d3d9Dll) { - D3DPERF_SetMarker = (PFN_D3DPERF_SET_MARKER )bx::dlsym(m_d3d9dll, "D3DPERF_SetMarker" ); - D3DPERF_BeginEvent = (PFN_D3DPERF_BEGIN_EVENT)bx::dlsym(m_d3d9dll, "D3DPERF_BeginEvent"); - D3DPERF_EndEvent = (PFN_D3DPERF_END_EVENT )bx::dlsym(m_d3d9dll, "D3DPERF_EndEvent" ); + D3DPERF_SetMarker = (PFN_D3DPERF_SET_MARKER )bx::dlsym(m_d3d9Dll, "D3DPERF_SetMarker" ); + D3DPERF_BeginEvent = (PFN_D3DPERF_BEGIN_EVENT)bx::dlsym(m_d3d9Dll, "D3DPERF_BeginEvent"); + D3DPERF_EndEvent = (PFN_D3DPERF_END_EVENT )bx::dlsym(m_d3d9Dll, "D3DPERF_EndEvent" ); BX_CHECK(NULL != D3DPERF_SetMarker && NULL != D3DPERF_BeginEvent && NULL != D3DPERF_EndEvent @@ -816,7 +816,7 @@ namespace bgfx { namespace d3d11 } } - D3D11CreateDevice = (PFN_D3D11_CREATE_DEVICE)bx::dlsym(m_d3d11dll, "D3D11CreateDevice"); + D3D11CreateDevice = (PFN_D3D11_CREATE_DEVICE)bx::dlsym(m_d3d11Dll, "D3D11CreateDevice"); if (NULL == D3D11CreateDevice) { BX_TRACE("Init error: Function D3D11CreateDevice not found."); @@ -824,7 +824,6 @@ namespace bgfx { namespace d3d11 } #endif // USE_D3D11_DYNAMIC_LIB - HRESULT hr; m_device = (ID3D11Device*)g_platformData.context; if (!m_dxgi.init(g_caps) ) @@ -836,7 +835,7 @@ namespace bgfx { namespace d3d11 if (NULL == m_device) { - if (NULL != m_renderdocdll) + if (NULL != m_renderDocDll) { setGraphicsDebuggerPresent(true); } @@ -855,6 +854,8 @@ namespace bgfx { namespace d3d11 #endif // BX_PLATFORM_WINRT }; + HRESULT hr = S_OK; + for (;;) { uint32_t flags = 0 @@ -933,7 +934,7 @@ namespace bgfx { namespace d3d11 for (uint32_t ii = 0; ii < BX_COUNTOF(s_d3dDeviceIIDs); ++ii) { ID3D11Device* device; - hr = m_device->QueryInterface(s_d3dDeviceIIDs[ii], (void**)&device); + HRESULT hr = m_device->QueryInterface(s_d3dDeviceIIDs[ii], (void**)&device); if (SUCCEEDED(hr) ) { device->Release(); // BK - ignore ref count. @@ -942,18 +943,19 @@ namespace bgfx { namespace d3d11 } } - /// - IDXGIDevice* renderdoc; - hr = m_device->QueryInterface(IID_IDXGIDeviceRenderDoc, (void**)&renderdoc); - if (SUCCEEDED(hr) ) - { - setGraphicsDebuggerPresent(true); - DX_RELEASE(renderdoc, 2); - } - else - { - IUnknown* device = m_device; - setGraphicsDebuggerPresent(2 != getRefCount(device) ); + { /// + IDXGIDevice* renderdoc; + HRESULT hr = m_device->QueryInterface(IID_IDXGIDeviceRenderDoc, (void**)&renderdoc); + if (SUCCEEDED(hr) ) + { + setGraphicsDebuggerPresent(true); + DX_RELEASE(renderdoc, 2); + } + else + { + IUnknown* device = m_device; + setGraphicsDebuggerPresent(2 != getRefCount(device) ); + } } if (BGFX_PCI_ID_NVIDIA != m_dxgi.m_adapterDesc.VendorId) @@ -963,6 +965,8 @@ namespace bgfx { namespace d3d11 if (NULL == g_platformData.backBuffer) { + HRESULT hr = S_OK; + #if BX_PLATFORM_WINDOWS m_swapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; m_swapBufferCount = 2; @@ -1071,7 +1075,7 @@ namespace bgfx { namespace d3d11 #if USE_D3D11_DYNAMIC_LIB if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) { - hr = m_deviceCtx->QueryInterface(IID_ID3DUserDefinedAnnotation, (void**)&m_annotation); + HRESULT hr = m_deviceCtx->QueryInterface(IID_ID3DUserDefinedAnnotation, (void**)&m_annotation); if (SUCCEEDED(hr) ) { @@ -1084,7 +1088,7 @@ namespace bgfx { namespace d3d11 if (_init.debug) { - hr = m_device->QueryInterface(IID_ID3D11InfoQueue, (void**)&m_infoQueue); + HRESULT hr = m_device->QueryInterface(IID_ID3D11InfoQueue, (void**)&m_infoQueue); if (SUCCEEDED(hr) ) { @@ -1210,7 +1214,7 @@ namespace bgfx { namespace d3d11 }; D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS data; - hr = m_device->CheckFeatureSupport(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &data, sizeof(data) ); + HRESULT hr = m_device->CheckFeatureSupport(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &data, sizeof(data) ); if (SUCCEEDED(hr) && data.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x) { @@ -1235,7 +1239,7 @@ namespace bgfx { namespace d3d11 }; D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT data; - hr = m_device->CheckFeatureSupport(D3D11_FEATURE(11) /*D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT*/, &data, sizeof(data) ); + HRESULT hr = m_device->CheckFeatureSupport(D3D11_FEATURE(11) /*D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT*/, &data, sizeof(data) ); if (SUCCEEDED(hr) && data.SimpleInstancingSupported) { @@ -1252,7 +1256,7 @@ namespace bgfx { namespace d3d11 }; D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT data; - hr = m_device->CheckFeatureSupport(D3D11_FEATURE(9) /*D3D11_FEATURE_D3D9_SHADOW_SUPPORT*/, &data, sizeof(data) ); + HRESULT hr = m_device->CheckFeatureSupport(D3D11_FEATURE(9) /*D3D11_FEATURE_D3D9_SHADOW_SUPPORT*/, &data, sizeof(data) ); if (SUCCEEDED(hr) && data.SupportsDepthAsTextureWithLessEqualComparisonFilter) { @@ -1282,7 +1286,7 @@ namespace bgfx { namespace d3d11 D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2 data.InFormat = fmt; - hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) ); + HRESULT hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) ); if (SUCCEEDED(hr) ) { support |= 0 != (data.OutFormatSupport & (0 @@ -1405,7 +1409,7 @@ namespace bgfx { namespace d3d11 D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2 data.InFormat = fmtSrgb; - hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) ); + HRESULT hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) ); if (SUCCEEDED(hr) ) { support |= 0 != (data.OutFormatSupport & (0 @@ -1513,10 +1517,10 @@ namespace bgfx { namespace d3d11 DX_RELEASE(m_device, 0); #if USE_D3D11_DYNAMIC_LIB - if (NULL != m_d3d9dll) + if (NULL != m_d3d9Dll) { - bx::dlclose(m_d3d9dll); - m_d3d9dll = NULL; + bx::dlclose(m_d3d9Dll); + m_d3d9Dll = NULL; } #endif // USE_D3D11_DYNAMIC_LIB @@ -1525,8 +1529,8 @@ namespace bgfx { namespace d3d11 #if USE_D3D11_DYNAMIC_LIB case ErrorState::LoadedD3D11: - bx::dlclose(m_d3d11dll); - m_d3d11dll = NULL; + bx::dlclose(m_d3d11Dll); + m_d3d11Dll = NULL; BX_FALLTHROUGH; #endif // USE_D3D11_DYNAMIC_LIB @@ -1540,10 +1544,10 @@ namespace bgfx { namespace d3d11 m_ags = NULL; } - bx::dlclose(m_agsdll); - m_agsdll = NULL; + bx::dlclose(m_agsDll); + m_agsDll = NULL; - unloadRenderDoc(m_renderdocdll); + unloadRenderDoc(m_renderDocDll); break; } @@ -1560,8 +1564,8 @@ namespace bgfx { namespace d3d11 m_ags = NULL; } - bx::dlclose(m_agsdll); - m_agsdll = NULL; + bx::dlclose(m_agsDll); + m_agsDll = NULL; m_deviceCtx->ClearState(); @@ -1601,17 +1605,17 @@ namespace bgfx { namespace d3d11 m_nvapi.shutdown(); m_dxgi.shutdown(); - unloadRenderDoc(m_renderdocdll); + unloadRenderDoc(m_renderDocDll); #if USE_D3D11_DYNAMIC_LIB - if (NULL != m_d3d9dll) + if (NULL != m_d3d9Dll) { - bx::dlclose(m_d3d9dll); - m_d3d9dll = NULL; + bx::dlclose(m_d3d9Dll); + m_d3d9Dll = NULL; } - bx::dlclose(m_d3d11dll); - m_d3d11dll = NULL; + bx::dlclose(m_d3d11Dll); + m_d3d11Dll = NULL; #endif // USE_D3D11_DYNAMIC_LIB } @@ -2354,11 +2358,10 @@ namespace bgfx { namespace d3d11 DX_RELEASE(m_swapChain, 0); - HRESULT hr; - hr = m_dxgi.createSwapChain(m_device - , m_scd - , &m_swapChain - ); + HRESULT hr = m_dxgi.createSwapChain(m_device + , m_scd + , &m_swapChain + ); BGFX_FATAL(SUCCEEDED(hr), bgfx::Fatal::UnableToInitialize, "Failed to create swap chain."); } @@ -3356,10 +3359,10 @@ namespace bgfx { namespace d3d11 } } - void* m_d3d9dll; - void* m_d3d11dll; - void* m_renderdocdll; - void* m_agsdll; + void* m_d3d9Dll; + void* m_d3d11Dll; + void* m_renderDocDll; + void* m_agsDll; Dxgi m_dxgi; AGSContext* m_ags; @@ -4547,8 +4550,7 @@ namespace bgfx { namespace d3d11 ID3D11Device* device = s_renderD3D11->m_device; - HRESULT hr; - hr = s_renderD3D11->m_dxgi.createSwapChain(device + HRESULT hr = s_renderD3D11->m_dxgi.createSwapChain(device , scd , &m_swapChain ); @@ -6213,7 +6215,7 @@ namespace bgfx { namespace d3d11 ); } - if (NULL != m_renderdocdll) + if (NULL != m_renderDocDll) { tvm.printf(tvm.m_width-27, 0, 0x4f, " [F11 - RenderDoc capture] "); } diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index f2be7ea3c..ec8fdbebe 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -611,8 +611,8 @@ namespace bgfx { namespace d3d12 struct RendererContextD3D12 : public RendererContextI { RendererContextD3D12() - : m_d3d12dll(NULL) - , m_renderdocdll(NULL) + : m_d3d12Dll(NULL) + , m_renderDocDll(NULL) , m_winPixEvent(NULL) , m_featureLevel(D3D_FEATURE_LEVEL(0) ) , m_swapChain(NULL) @@ -670,24 +670,24 @@ namespace bgfx { namespace d3d12 if (_init.debug || _init.profile) { - m_renderdocdll = loadRenderDoc(); + m_renderDocDll = loadRenderDoc(); } - setGraphicsDebuggerPresent(NULL != m_renderdocdll || NULL != m_winPixEvent); + setGraphicsDebuggerPresent(NULL != m_renderDocDll || NULL != m_winPixEvent); m_fbh.idx = kInvalidHandle; bx::memSet(m_uniforms, 0, sizeof(m_uniforms) ); bx::memSet(&m_resolution, 0, sizeof(m_resolution) ); #if USE_D3D12_DYNAMIC_LIB - m_kernel32dll = bx::dlopen("kernel32.dll"); - if (NULL == m_kernel32dll) + m_kernel32Dll = bx::dlopen("kernel32.dll"); + if (NULL == m_kernel32Dll) { BX_TRACE("Init error: Failed to load kernel32.dll."); goto error; } - CreateEventExA = (PFN_CREATE_EVENT_EX_A)bx::dlsym(m_kernel32dll, "CreateEventExA"); + CreateEventExA = (PFN_CREATE_EVENT_EX_A)bx::dlsym(m_kernel32Dll, "CreateEventExA"); if (NULL == CreateEventExA) { BX_TRACE("Init error: Function CreateEventExA not found."); @@ -698,8 +698,8 @@ namespace bgfx { namespace d3d12 m_nvapi.init(); - m_d3d12dll = bx::dlopen("d3d12.dll"); - if (NULL == m_d3d12dll) + m_d3d12Dll = bx::dlopen("d3d12.dll"); + if (NULL == m_d3d12Dll) { BX_TRACE("Init error: Failed to load d3d12.dll."); goto error; @@ -707,16 +707,16 @@ namespace bgfx { namespace d3d12 errorState = ErrorState::LoadedD3D12; - D3D12EnableExperimentalFeatures = (PFN_D3D12_ENABLE_EXPERIMENTAL_FEATURES)bx::dlsym(m_d3d12dll, "D3D12EnableExperimentalFeatures"); + D3D12EnableExperimentalFeatures = (PFN_D3D12_ENABLE_EXPERIMENTAL_FEATURES)bx::dlsym(m_d3d12Dll, "D3D12EnableExperimentalFeatures"); BX_WARN(NULL != D3D12EnableExperimentalFeatures, "Function D3D12EnableExperimentalFeatures not found."); - D3D12CreateDevice = (PFN_D3D12_CREATE_DEVICE)bx::dlsym(m_d3d12dll, "D3D12CreateDevice"); + D3D12CreateDevice = (PFN_D3D12_CREATE_DEVICE)bx::dlsym(m_d3d12Dll, "D3D12CreateDevice"); BX_WARN(NULL != D3D12CreateDevice, "Function D3D12CreateDevice not found."); - D3D12GetDebugInterface = (PFN_D3D12_GET_DEBUG_INTERFACE)bx::dlsym(m_d3d12dll, "D3D12GetDebugInterface"); + D3D12GetDebugInterface = (PFN_D3D12_GET_DEBUG_INTERFACE)bx::dlsym(m_d3d12Dll, "D3D12GetDebugInterface"); BX_WARN(NULL != D3D12GetDebugInterface, "Function D3D12GetDebugInterface not found."); - D3D12SerializeRootSignature = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)bx::dlsym(m_d3d12dll, "D3D12SerializeRootSignature"); + D3D12SerializeRootSignature = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)bx::dlsym(m_d3d12Dll, "D3D12SerializeRootSignature"); BX_WARN(NULL != D3D12SerializeRootSignature, "Function D3D12SerializeRootSignature not found."); if (NULL == D3D12CreateDevice @@ -1304,11 +1304,11 @@ namespace bgfx { namespace d3d12 #if USE_D3D12_DYNAMIC_LIB case ErrorState::LoadedDXGI: case ErrorState::LoadedD3D12: - bx::dlclose(m_d3d12dll); + bx::dlclose(m_d3d12Dll); BX_FALLTHROUGH; case ErrorState::LoadedKernel32: - bx::dlclose(m_kernel32dll); + bx::dlclose(m_kernel32Dll); BX_FALLTHROUGH; #endif // USE_D3D12_DYNAMIC_LIB @@ -1316,7 +1316,7 @@ namespace bgfx { namespace d3d12 default: m_nvapi.shutdown(); - unloadRenderDoc(m_renderdocdll); + unloadRenderDoc(m_renderDocDll); bx::dlclose(m_winPixEvent); m_winPixEvent = NULL; break; @@ -1383,14 +1383,14 @@ namespace bgfx { namespace d3d12 m_nvapi.shutdown(); m_dxgi.shutdown(); - unloadRenderDoc(m_renderdocdll); + unloadRenderDoc(m_renderDocDll); bx::dlclose(m_winPixEvent); m_winPixEvent = NULL; #if USE_D3D12_DYNAMIC_LIB - bx::dlclose(m_d3d12dll); - bx::dlclose(m_kernel32dll); + bx::dlclose(m_d3d12Dll); + bx::dlclose(m_kernel32Dll); #endif // USE_D3D12_DYNAMIC_LIB } @@ -3161,9 +3161,9 @@ namespace bgfx { namespace d3d12 Dxgi m_dxgi; NvApi m_nvapi; - void* m_kernel32dll; - void* m_d3d12dll; - void* m_renderdocdll; + void* m_kernel32Dll; + void* m_d3d12Dll; + void* m_renderDocDll; void* m_winPixEvent; D3D_FEATURE_LEVEL m_featureLevel; @@ -6536,7 +6536,7 @@ namespace bgfx { namespace d3d12 , m_batch.m_stats.m_numImmediate[BatchD3D12::DrawIndexed] ); - if (NULL != m_renderdocdll) + if (NULL != m_renderDocDll) { tvm.printf(tvm.m_width-27, 0, 0x4f, " [F11 - RenderDoc capture] "); } diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 789cb214e..c3712728a 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -443,9 +443,9 @@ namespace bgfx { namespace d3d9 m_params.BackBufferWidth = rect.right-rect.left; m_params.BackBufferHeight = rect.bottom-rect.top; - m_d3d9dll = bx::dlopen("d3d9.dll"); + m_d3d9Dll = bx::dlopen("d3d9.dll"); - if (NULL == m_d3d9dll) + if (NULL == m_d3d9Dll) { BX_TRACE("Init error: Failed to load d3d9.dll."); goto error; @@ -457,9 +457,9 @@ namespace bgfx { namespace d3d9 if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) { - D3DPERF_SetMarker = (PFN_D3DPERF_SET_MARKER )bx::dlsym(m_d3d9dll, "D3DPERF_SetMarker"); - D3DPERF_BeginEvent = (PFN_D3DPERF_BEGIN_EVENT)bx::dlsym(m_d3d9dll, "D3DPERF_BeginEvent"); - D3DPERF_EndEvent = (PFN_D3DPERF_END_EVENT )bx::dlsym(m_d3d9dll, "D3DPERF_EndEvent"); + D3DPERF_SetMarker = (PFN_D3DPERF_SET_MARKER )bx::dlsym(m_d3d9Dll, "D3DPERF_SetMarker"); + D3DPERF_BeginEvent = (PFN_D3DPERF_BEGIN_EVENT)bx::dlsym(m_d3d9Dll, "D3DPERF_BeginEvent"); + D3DPERF_EndEvent = (PFN_D3DPERF_END_EVENT )bx::dlsym(m_d3d9Dll, "D3DPERF_EndEvent"); BX_CHECK(NULL != D3DPERF_SetMarker && NULL != D3DPERF_BeginEvent @@ -471,7 +471,7 @@ namespace bgfx { namespace d3d9 m_d3d9ex = NULL; m_deviceEx = NULL; - Direct3DCreate9Ex = (Direct3DCreate9ExFn)bx::dlsym(m_d3d9dll, "Direct3DCreate9Ex"); + Direct3DCreate9Ex = (Direct3DCreate9ExFn)bx::dlsym(m_d3d9Dll, "Direct3DCreate9Ex"); if (BX_ENABLED(BGFX_CONFIG_RENDERER_DIRECT3D9EX) && NULL != Direct3DCreate9Ex) { @@ -493,7 +493,7 @@ namespace bgfx { namespace d3d9 if (NULL == m_d3d9) { - Direct3DCreate9 = (Direct3DCreate9Fn)bx::dlsym(m_d3d9dll, "Direct3DCreate9"); + Direct3DCreate9 = (Direct3DCreate9Fn)bx::dlsym(m_d3d9Dll, "Direct3DCreate9"); if (NULL == Direct3DCreate9) { @@ -885,7 +885,7 @@ namespace bgfx { namespace d3d9 case ErrorState::LoadedD3D9: m_nvapi.shutdown(); - bx::dlclose(m_d3d9dll); + bx::dlclose(m_d3d9Dll); BX_FALLTHROUGH; case ErrorState::Default: @@ -933,7 +933,7 @@ namespace bgfx { namespace d3d9 } m_nvapi.shutdown(); - bx::dlclose(m_d3d9dll); + bx::dlclose(m_d3d9Dll); m_initialized = false; } @@ -2206,7 +2206,7 @@ namespace bgfx { namespace d3d9 IDirect3DVertexDeclaration9* m_instanceDataDecls[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT]; - void* m_d3d9dll; + void* m_d3d9Dll; NvApi m_nvapi; uint32_t m_adapter; D3DDEVTYPE m_deviceType; diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index 2973448e9..e1e0992ef 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -700,8 +700,8 @@ VK_IMPORT_DEVICE { RendererContextVK() : m_allocatorCb(NULL) - , m_renderdocdll(NULL) - , m_vulkan1dll(NULL) + , m_renderDocDll(NULL) + , m_vulkan1Dll(NULL) , m_maxAnisotropy(1) , m_depthClamp(false) , m_wireframe(false) @@ -746,10 +746,10 @@ VK_IMPORT_DEVICE if (_init.debug || _init.profile) { - m_renderdocdll = loadRenderDoc(); + m_renderDocDll = loadRenderDoc(); } - m_vulkan1dll = bx::dlopen( + m_vulkan1Dll = bx::dlopen( #if BX_PLATFORM_WINDOWS "vulkan-1.dll" #elif BX_PLATFORM_ANDROID @@ -759,7 +759,7 @@ VK_IMPORT_DEVICE #endif // BX_PLATFORM_* ); - if (NULL == m_vulkan1dll) + if (NULL == m_vulkan1Dll) { BX_TRACE("Init error: Failed to load vulkan dynamic library."); goto error; @@ -768,10 +768,10 @@ VK_IMPORT_DEVICE errorState = ErrorState::LoadedVulkan1; BX_TRACE("Shared library functions:"); -#define VK_IMPORT_FUNC(_optional, _func) \ - _func = (PFN_##_func)bx::dlsym(m_vulkan1dll, #_func); \ - BX_TRACE("\t%p " #_func, _func); \ - imported &= _optional || NULL != _func +#define VK_IMPORT_FUNC(_optional, _func) \ + _func = (PFN_##_func)bx::dlsym(m_vulkan1Dll, #_func); \ + BX_TRACE("\t%p " #_func, _func); \ + imported &= _optional || NULL != _func VK_IMPORT #undef VK_IMPORT_FUNC @@ -1842,10 +1842,10 @@ VK_IMPORT_DEVICE BX_FALLTHROUGH; case ErrorState::LoadedVulkan1: - bx::dlclose(m_vulkan1dll); - m_vulkan1dll = NULL; + bx::dlclose(m_vulkan1Dll); + m_vulkan1Dll = NULL; m_allocatorCb = NULL; - unloadRenderDoc(m_renderdocdll); + unloadRenderDoc(m_renderDocDll); BX_FALLTHROUGH; case ErrorState::Default: @@ -1938,10 +1938,10 @@ VK_IMPORT_DEVICE vkDestroyInstance(m_instance, m_allocatorCb); - bx::dlclose(m_vulkan1dll); - m_vulkan1dll = NULL; + bx::dlclose(m_vulkan1Dll); + m_vulkan1Dll = NULL; m_allocatorCb = NULL; - unloadRenderDoc(m_renderdocdll); + unloadRenderDoc(m_renderDocDll); } RendererType::Enum getRendererType() const override @@ -3051,8 +3051,8 @@ VK_IMPORT_DEVICE VkPipelineCache m_pipelineCache; VkCommandPool m_commandPool; - void* m_renderdocdll; - void* m_vulkan1dll; + void* m_renderDocDll; + void* m_vulkan1Dll; IndexBufferVK m_indexBuffers[BGFX_CONFIG_MAX_INDEX_BUFFERS]; VertexBufferVK m_vertexBuffers[BGFX_CONFIG_MAX_VERTEX_BUFFERS]; @@ -4528,7 +4528,7 @@ BX_UNUSED(presentMin, presentMax); // , m_batch.m_stats.m_numImmediate[BatchD3D12::DrawIndexed] // ); - if (NULL != m_renderdocdll) + if (NULL != m_renderDocDll) { tvm.printf(tvm.m_width-27, 0, 0x4f, " [F11 - RenderDoc capture] "); }