diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-12-21 20:47:56 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-12-21 20:47:56 +0000 |
| commit | 0bc0ea3dcd760b864f1388359403f76916b9b100 (patch) | |
| tree | 6d02cc4433d2cc56f3d75d578892679175701781 /Graphics/GraphicsEngineD3D12 | |
| parent | Removed SBTTransitionMode from TraceRaysAttribs (diff) | |
| download | DiligentCore-0bc0ea3dcd760b864f1388359403f76916b9b100.tar.gz DiligentCore-0bc0ea3dcd760b864f1388359403f76916b9b100.zip | |
Vulkan backend: code clean-up
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp index da9fd65e..69f7f0db 100644 --- a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp +++ b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp @@ -121,16 +121,17 @@ private: DescriptorHeapAllocation m_CBVDescriptorAllocation; // Align the struct size to the cache line size to avoid false sharing - struct alignas(64) CtxDynamicData : D3D12DynamicAllocation + static constexpr size_t CacheLineSize = 64; + struct alignas(CacheLineSize) CtxDynamicData : D3D12DynamicAllocation { CtxDynamicData& operator=(const D3D12DynamicAllocation& Allocation) { *static_cast<D3D12DynamicAllocation*>(this) = Allocation; return *this; } - Uint8 Padding[64 - sizeof(D3D12DynamicAllocation)]; + Uint8 Padding[CacheLineSize - sizeof(D3D12DynamicAllocation)]; }; - static_assert(sizeof(CtxDynamicData) == 64, "Unexpected sizeof(CtxDynamicData)"); + static_assert(sizeof(CtxDynamicData) == CacheLineSize, "Unexpected sizeof(CtxDynamicData)"); friend class DeviceContextD3D12Impl; // Array of dynamic allocations for every device context. |
