diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2017-12-28 05:45:08 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2017-12-28 05:45:08 +0000 |
| commit | 5cf012cfbc7017b46912b9f59a9f76a2d4b870b3 (patch) | |
| tree | 911054514a37c26a82cb4152bf04fcf148d9556b /Graphics/GraphicsTools | |
| parent | Removed legacy visual studio project and solution files (diff) | |
| download | DiligentCore-5cf012cfbc7017b46912b9f59a9f76a2d4b870b3.tar.gz DiligentCore-5cf012cfbc7017b46912b9f59a9f76a2d4b870b3.zip | |
Reworked Common and Platform modules to break interdependenices;
Replaced static const->static constexpr where appropriate
Diffstat (limited to 'Graphics/GraphicsTools')
10 files changed, 27 insertions, 27 deletions
diff --git a/Graphics/GraphicsTools/include/BasicShaderSourceStreamFactory.h b/Graphics/GraphicsTools/include/BasicShaderSourceStreamFactory.h index 24e87df5..7d485a87 100644 --- a/Graphics/GraphicsTools/include/BasicShaderSourceStreamFactory.h +++ b/Graphics/GraphicsTools/include/BasicShaderSourceStreamFactory.h @@ -33,9 +33,9 @@ namespace Diligent public: BasicShaderSourceStreamFactory( const Char *SearchDirectories = nullptr ); - virtual void CreateInputStream( const Diligent::Char *Name, IFileStream **ppStream )override; + virtual void CreateInputStream( const Char *Name, IFileStream **ppStream )override; private: - std::vector<Diligent::String> m_SearchDirectories; + std::vector<String> m_SearchDirectories; }; } diff --git a/Graphics/GraphicsTools/include/RingBuffer.h b/Graphics/GraphicsTools/include/RingBuffer.h index e053eefe..684f31e0 100644 --- a/Graphics/GraphicsTools/include/RingBuffer.h +++ b/Graphics/GraphicsTools/include/RingBuffer.h @@ -98,7 +98,7 @@ namespace Diligent ~RingBuffer() { - VERIFY(m_UsedSize==0, "All space in the ring buffer must be released") + VERIFY(m_UsedSize==0, "All space in the ring buffer must be released"); } OffsetType Allocate(OffsetType Size) diff --git a/Graphics/GraphicsTools/include/VariableSizeAllocationsManager.h b/Graphics/GraphicsTools/include/VariableSizeAllocationsManager.h index 8285125b..99d78ab7 100644 --- a/Graphics/GraphicsTools/include/VariableSizeAllocationsManager.h +++ b/Graphics/GraphicsTools/include/VariableSizeAllocationsManager.h @@ -58,7 +58,7 @@ namespace Diligent { public: typedef size_t OffsetType; - static const OffsetType InvalidOffset = static_cast<OffsetType>(-1); + static constexpr OffsetType InvalidOffset = static_cast<OffsetType>(-1); private: struct FreeBlockInfo; diff --git a/Graphics/GraphicsTools/include/VariableSizeGPUAllocationsManager.h b/Graphics/GraphicsTools/include/VariableSizeGPUAllocationsManager.h index f299ca07..e929ee7b 100644 --- a/Graphics/GraphicsTools/include/VariableSizeGPUAllocationsManager.h +++ b/Graphics/GraphicsTools/include/VariableSizeGPUAllocationsManager.h @@ -57,7 +57,7 @@ namespace Diligent ~VariableSizeGPUAllocationsManager() { VERIFY(m_StaleAllocations.empty(), "Not all stale allocations released"); - VERIFY(m_StaleAllocationsSize == 0, "Not all stale allocations released") + VERIFY(m_StaleAllocationsSize == 0, "Not all stale allocations released"); } // = default causes compiler error when instantiating std::vector::emplace_back() in Visual Studio 2015 (Version 14.0.23107.0 D14REL) diff --git a/Graphics/GraphicsTools/src/BasicShaderSourceStreamFactory.cpp b/Graphics/GraphicsTools/src/BasicShaderSourceStreamFactory.cpp index b35d3427..d0829860 100644 --- a/Graphics/GraphicsTools/src/BasicShaderSourceStreamFactory.cpp +++ b/Graphics/GraphicsTools/src/BasicShaderSourceStreamFactory.cpp @@ -81,7 +81,7 @@ namespace Diligent else { *ppStream = nullptr; - LOG_ERROR( "Failed to create input stream for source file ", Name ) + LOG_ERROR( "Failed to create input stream for source file ", Name ); } } }
\ No newline at end of file diff --git a/Graphics/GraphicsTools/src/GraphicsUtilities.cpp b/Graphics/GraphicsTools/src/GraphicsUtilities.cpp index 0cae06ac..75e42b35 100644 --- a/Graphics/GraphicsTools/src/GraphicsUtilities.cpp +++ b/Graphics/GraphicsTools/src/GraphicsUtilities.cpp @@ -60,7 +60,7 @@ const Char* GetValueTypeString( VALUE_TYPE Val ) } else { - UNEXPECTED( "Incorrect value type (", Val, ")" ) + UNEXPECTED( "Incorrect value type (", Val, ")" ); return "unknown value type"; } } @@ -455,7 +455,7 @@ const Char *GetBufferViewTypeLiteralName( BUFFER_VIEW_TYPE ViewType ) } else { - UNEXPECTED( "Buffer view type (", ViewType, ") is out of allowed range [0, ", BUFFER_VIEW_NUM_VIEWS-1, "]" ) + UNEXPECTED( "Buffer view type (", ViewType, ") is out of allowed range [0, ", BUFFER_VIEW_NUM_VIEWS-1, "]" ); return "<Unknown buffer view type>"; } } @@ -502,7 +502,7 @@ const Char *GetShaderVariableTypeLiteralName(SHADER_VARIABLE_TYPE VarType, bool return (bGetFullName ? FullVarTypeNameStrings : ShortVarTypeNameStrings)[VarType]; else { - UNEXPECTED("Unknow shader variable type") + UNEXPECTED("Unknow shader variable type"); return "unknow"; } } @@ -526,7 +526,7 @@ const Char* GetUsageString( USAGE Usage ) return UsageStrings[Usage]; else { - UNEXPECTED("Unknow usage" ) + UNEXPECTED("Unknow usage"); return "Unknown usage"; } } @@ -554,7 +554,7 @@ const Char* GetResourceDimString( RESOURCE_DIMENSION TexType ) return TexTypeStrings[TexType]; else { - UNEXPECTED("Unknow texture type") + UNEXPECTED("Unknow texture type"); return "Unknow texture type"; } } @@ -766,7 +766,7 @@ Uint32 ComputeMipLevelsCount( Uint32 Width ) Uint32 MipLevels = 0; while( (Width >> MipLevels) > 0 ) ++MipLevels; - VERIFY( Width >= (1U << (MipLevels-1)) && Width < (1U << MipLevels), "Incorrect number of Mip levels" ) + VERIFY( Width >= (1U << (MipLevels-1)) && Width < (1U << MipLevels), "Incorrect number of Mip levels" ); return MipLevels; } @@ -857,7 +857,7 @@ void GenerateCheckerBoardPattern(Uint32 Width, Uint32 Height, TEXTURE_FORMAT Fmt break; default: - UNSUPPORTED("Unsupported component type") + UNSUPPORTED("Unsupported component type"); return; } } diff --git a/Graphics/GraphicsTools/src/TextureUploader.cpp b/Graphics/GraphicsTools/src/TextureUploader.cpp index ddc930ef..533634a2 100644 --- a/Graphics/GraphicsTools/src/TextureUploader.cpp +++ b/Graphics/GraphicsTools/src/TextureUploader.cpp @@ -47,7 +47,7 @@ namespace Diligent break; default: - UNEXPECTED("Unexpected device type") + UNEXPECTED("Unexpected device type"); } if (*ppUploader != nullptr) (*ppUploader)->AddRef(); diff --git a/Graphics/GraphicsTools/src/TextureUploaderD3D11.cpp b/Graphics/GraphicsTools/src/TextureUploaderD3D11.cpp index 3677f7eb..16cc74a1 100644 --- a/Graphics/GraphicsTools/src/TextureUploaderD3D11.cpp +++ b/Graphics/GraphicsTools/src/TextureUploaderD3D11.cpp @@ -47,8 +47,8 @@ namespace Diligent ~UploadBufferD3D11() { - if(m_pStagingTexture) - LOG_INFO_MESSAGE("UploadBufferD3D11: releasing ", m_Desc.Width, 'x', m_Desc.Height, " Fmt=", m_Desc.Format, " staging texture") + if (m_pStagingTexture) + LOG_INFO_MESSAGE("UploadBufferD3D11: releasing ", m_Desc.Width, 'x', m_Desc.Height, " Fmt=", m_Desc.Format, " staging texture"); } void SetDataPtr(void *pData, size_t RowStride, size_t DepthStride) @@ -179,7 +179,7 @@ namespace Diligent { const auto &desc = BuffQueueIt.first; auto &FmtInfo = m_pDevice->GetTextureFormatInfo(desc.Format); - LOG_INFO_MESSAGE("TextureUploaderD3D11: releasing ", BuffQueueIt.second.size(), ' ', desc.Width, 'x', desc.Height, 'x', desc.Depth, ' ', FmtInfo.Name, " staging texture(s) ") + LOG_INFO_MESSAGE("TextureUploaderD3D11: releasing ", BuffQueueIt.second.size(), ' ', desc.Width, 'x', desc.Height, 'x', desc.Depth, ' ', FmtInfo.Name, " staging texture(s) "); } } } @@ -222,7 +222,7 @@ namespace Diligent } else { - LOG_ERROR("Unknown DX error when mapping staging texture: ", hr) + LOG_ERROR("Unknown DX error when mapping staging texture: ", hr); } } } @@ -289,11 +289,11 @@ namespace Diligent HRESULT hr = m_pInternalData->m_pd3d11NativeDevice->CreateTexture2D(&StagingTexDesc, nullptr, &pStagingTex); if (FAILED(hr)) { - LOG_ERROR_MESSAGE("Failed to allocate staging D3D11 texture") - return; + LOG_ERROR_MESSAGE("Failed to allocate staging D3D11 texture"); + return; } - LOG_INFO_MESSAGE("TextureUploaderD3D11: created ", Desc.Width, 'x', Desc.Height, ' ', m_pDevice->GetTextureFormatInfo(Desc.Format).Name, " staging texture") + LOG_INFO_MESSAGE("TextureUploaderD3D11: created ", Desc.Width, 'x', Desc.Height, ' ', m_pDevice->GetTextureFormatInfo(Desc.Format).Name, " staging texture"); RefCntAutoPtr<UploadBufferD3D11> pUploadBuffer(MakeNewRCObj<UploadBufferD3D11>()(Desc, pStagingTex)); m_pInternalData->EnqueMap(pUploadBuffer, InternalData::PendingBufferOperation::Map); diff --git a/Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp b/Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp index 2791d914..85f57257 100644 --- a/Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp +++ b/Graphics/GraphicsTools/src/TextureUploaderD3D12.cpp @@ -59,7 +59,7 @@ namespace Diligent ~UploadBufferD3D12() { m_pStagingBuffer->Unmap(nullptr, MAP_WRITE, 0); - LOG_INFO_MESSAGE("Releasing staging buffer of size ", m_pStagingBuffer->GetDesc().uiSizeInBytes ) + LOG_INFO_MESSAGE("Releasing staging buffer of size ", m_pStagingBuffer->GetDesc().uiSizeInBytes); } void SignalCopyScheduled() @@ -156,7 +156,7 @@ namespace Diligent { const auto &desc = BuffQueueIt.first; auto &FmtInfo = m_pDevice->GetTextureFormatInfo(desc.Format); - LOG_INFO_MESSAGE("TextureUploaderD3D12: releasing ", BuffQueueIt.second.size(), ' ', desc.Width, 'x', desc.Height, 'x', desc.Depth, ' ', FmtInfo.Name, " upload buffer(s) ") + LOG_INFO_MESSAGE("TextureUploaderD3D12: releasing ", BuffQueueIt.second.size(), ' ', desc.Width, 'x', desc.Height, 'x', desc.Depth, ' ', FmtInfo.Name, " upload buffer(s) "); } } } @@ -238,11 +238,11 @@ namespace Diligent pStagingBuffer->Map(nullptr, MAP_WRITE, 0, CpuVirtualAddress); if (CpuVirtualAddress == nullptr) { - LOG_ERROR_MESSAGE("Failed to map upload buffer") + LOG_ERROR_MESSAGE("Failed to map upload buffer"); return; } - LOG_INFO_MESSAGE("Created staging buffer of size ", BuffDesc.uiSizeInBytes ) + LOG_INFO_MESSAGE("Created staging buffer of size ", BuffDesc.uiSizeInBytes); RefCntAutoPtr<UploadBufferD3D12> pUploadBuffer(MakeNewRCObj<UploadBufferD3D12>()(m_pInternalData->m_pDeviceD3D12, Desc, pStagingBuffer, CpuVirtualAddress, RowStride, 0)); *ppBuffer = pUploadBuffer.Detach(); diff --git a/Graphics/GraphicsTools/src/TextureUploaderGL.cpp b/Graphics/GraphicsTools/src/TextureUploaderGL.cpp index 2eee70f4..4158fc89 100644 --- a/Graphics/GraphicsTools/src/TextureUploaderGL.cpp +++ b/Graphics/GraphicsTools/src/TextureUploaderGL.cpp @@ -150,7 +150,7 @@ namespace Diligent { const auto &desc = BuffQueueIt.first; auto &FmtInfo = m_pDevice->GetTextureFormatInfo(desc.Format); - LOG_INFO_MESSAGE("TextureUploaderGL: releasing ", BuffQueueIt.second.size(), ' ', desc.Width, 'x', desc.Height, 'x', desc.Depth, ' ', FmtInfo.Name, " upload buffer(s) ") + LOG_INFO_MESSAGE("TextureUploaderGL: releasing ", BuffQueueIt.second.size(), ' ', desc.Width, 'x', desc.Height, 'x', desc.Depth, ' ', FmtInfo.Name, " upload buffer(s) "); } } } @@ -240,7 +240,7 @@ namespace Diligent if( !pUploadBuffer ) { pUploadBuffer = MakeNewRCObj<UploadBufferGL>()(Desc); - LOG_INFO_MESSAGE("TextureUploaderGL: created upload buffer for ", Desc.Width, 'x', Desc.Height, 'x', Desc.Depth, ' ', m_pDevice->GetTextureFormatInfo(Desc.Format).Name, " texture" ) + LOG_INFO_MESSAGE("TextureUploaderGL: created upload buffer for ", Desc.Width, 'x', Desc.Height, 'x', Desc.Depth, ' ', m_pDevice->GetTextureFormatInfo(Desc.Format).Name, " texture"); } m_pInternalData->EnqueMap(pUploadBuffer); |
