diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-12-24 07:20:10 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-12-24 07:20:10 +0000 |
| commit | 72169d31c7f8a8e1f0a011e45b19ea7710eef985 (patch) | |
| tree | 935085a90a27216001289ddfcea2f999ce6b90cc /Graphics/GraphicsEngine | |
| parent | Fixed CMake warning when processing SPIRV-Tools-shared on Mac (diff) | |
| download | DiligentCore-72169d31c7f8a8e1f0a011e45b19ea7710eef985.tar.gz DiligentCore-72169d31c7f8a8e1f0a011e45b19ea7710eef985.zip | |
Fixed multiple unused variable warnings in clang release build
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/include/DeviceContextBase.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h index 23bd88c9..cd37a9e3 100644 --- a/Graphics/GraphicsEngine/include/DeviceContextBase.h +++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h @@ -717,10 +717,12 @@ inline void DeviceContextBase<BaseInterface,ImplementationTraits> :: UpdateBuffer(IBuffer* pBuffer, Uint32 Offset, Uint32 Size, const PVoid pData, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) { VERIFY(pBuffer != nullptr, "Buffer must not be null"); +#ifdef DEVELOPMENT const auto& BuffDesc = ValidatedCast<BufferImplType>(pBuffer)->GetDesc(); DEV_CHECK_ERR(BuffDesc.Usage == USAGE_DEFAULT, "Unable to update buffer '", BuffDesc.Name, "': only USAGE_DEFAULT buffers can be updated with UpdateData()"); DEV_CHECK_ERR(Offset < BuffDesc.uiSizeInBytes, "Unable to update buffer '", BuffDesc.Name, "': offset (", Offset, ") exceeds the buffer size (", BuffDesc.uiSizeInBytes, ")" ); DEV_CHECK_ERR(Size + Offset <= BuffDesc.uiSizeInBytes, "Unable to update buffer '", BuffDesc.Name, "': Update region [", Offset, ",", Size + Offset, ") is out of buffer bounds [0,", BuffDesc.uiSizeInBytes, ")" ); +#endif } template<typename BaseInterface, typename ImplementationTraits> @@ -735,10 +737,12 @@ inline void DeviceContextBase<BaseInterface,ImplementationTraits> :: { VERIFY(pSrcBuffer != nullptr, "Source buffer must not be null"); VERIFY(pDstBuffer != nullptr, "Destination buffer must not be null"); +#ifdef DEVELOPMENT const auto& SrcBufferDesc = ValidatedCast<BufferImplType>(pSrcBuffer)->GetDesc(); const auto& DstBufferDesc = ValidatedCast<BufferImplType>(pDstBuffer)->GetDesc(); DEV_CHECK_ERR( DstOffset + Size <= DstBufferDesc.uiSizeInBytes, "Failed to copy buffer '", SrcBufferDesc.Name, "' to '", DstBufferDesc.Name, "': Destination range [", DstOffset, ",", DstOffset + Size, ") is out of buffer bounds [0,", DstBufferDesc.uiSizeInBytes, ")" ); DEV_CHECK_ERR( SrcOffset + Size <= SrcBufferDesc.uiSizeInBytes, "Failed to copy buffer '", SrcBufferDesc.Name, "' to '", DstBufferDesc.Name, "': Source range [", SrcOffset, ",", SrcOffset + Size, ") is out of buffer bounds [0,", SrcBufferDesc.uiSizeInBytes, ")" ); +#endif } template<typename BaseInterface, typename ImplementationTraits> |
