summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-01-19 17:44:57 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-01-19 17:44:57 +0000
commit65b88200aae28dcd4b3e48672126bc7556d7bb49 (patch)
tree98d3cacead7e6e9824a0e5b04999d4b70543be28 /Graphics/GraphicsEngine
parentEnabled MacOS build (diff)
downloadDiligentCore-65b88200aae28dcd4b3e48672126bc7556d7bb49.tar.gz
DiligentCore-65b88200aae28dcd4b3e48672126bc7556d7bb49.zip
Fixed some clang compiler warnings
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/DeviceObjectBase.h2
-rw-r--r--Graphics/GraphicsEngine/include/RenderDeviceBase.h2
-rw-r--r--Graphics/GraphicsEngine/include/ShaderResourceBindingBase.h4
-rw-r--r--Graphics/GraphicsEngine/include/StateObjectsRegistry.h4
-rw-r--r--Graphics/GraphicsEngine/interface/MapHelper.h4
-rw-r--r--Graphics/GraphicsEngine/interface/PipelineState.h29
6 files changed, 18 insertions, 27 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceObjectBase.h b/Graphics/GraphicsEngine/include/DeviceObjectBase.h
index f7e05d7a..af5fed00 100644
--- a/Graphics/GraphicsEngine/include/DeviceObjectBase.h
+++ b/Graphics/GraphicsEngine/include/DeviceObjectBase.h
@@ -54,9 +54,9 @@ public:
const ObjectDescType &ObjDesc,
bool bIsDeviceInternal = false) :
TBase(pRefCounters),
- m_pDevice( pDevice ),
// Do not keep strong reference to the device if the object is an internal device object
m_spDevice( bIsDeviceInternal ? nullptr : pDevice ),
+ m_pDevice( pDevice ),
m_ObjectNameCopy(ObjDesc.Name ? ObjDesc.Name : ""),
m_Desc( ObjDesc )
{
diff --git a/Graphics/GraphicsEngine/include/RenderDeviceBase.h b/Graphics/GraphicsEngine/include/RenderDeviceBase.h
index f26c4afa..16d84daf 100644
--- a/Graphics/GraphicsEngine/include/RenderDeviceBase.h
+++ b/Graphics/GraphicsEngine/include/RenderDeviceBase.h
@@ -209,10 +209,10 @@ public:
size_t PSOSize,
size_t SRBSize) :
TObjectBase(pRefCounters),
+ m_SamplersRegistry(RawMemAllocator, "sampler"),
m_TextureFormatsInfo( TEX_FORMAT_NUM_FORMATS, TextureFormatInfoExt(), STD_ALLOCATOR_RAW_MEM(TextureFormatInfoExt, RawMemAllocator, "Allocator for vector<TextureFormatInfoExt>") ),
m_TexFmtInfoInitFlags( TEX_FORMAT_NUM_FORMATS, false, STD_ALLOCATOR_RAW_MEM(bool, RawMemAllocator, "Allocator for vector<bool>") ),
m_wpDeferredContexts(NumDeferredContexts, RefCntWeakPtr<IDeviceContext>(), STD_ALLOCATOR_RAW_MEM(RefCntWeakPtr<IDeviceContext>, RawMemAllocator, "Allocator for vector< RefCntWeakPtr<IDeviceContext> >")),
- m_SamplersRegistry(RawMemAllocator, "sampler"),
m_TexObjAllocator(RawMemAllocator, TextureObjSize, 64),
m_TexViewObjAllocator(RawMemAllocator, TexViewObjSize, 64),
m_BufObjAllocator(RawMemAllocator, BufferObjSize, 128),
diff --git a/Graphics/GraphicsEngine/include/ShaderResourceBindingBase.h b/Graphics/GraphicsEngine/include/ShaderResourceBindingBase.h
index b2e0c923..14e4e89e 100644
--- a/Graphics/GraphicsEngine/include/ShaderResourceBindingBase.h
+++ b/Graphics/GraphicsEngine/include/ShaderResourceBindingBase.h
@@ -50,8 +50,8 @@ public:
/// must not keep a strong reference to the PSO.
ShaderResourceBindingBase( IReferenceCounters *pRefCounters, IPipelineState *pPSO, bool IsInternal = false ) :
TObjectBase( pRefCounters ),
- m_pPSO( pPSO ),
- m_spPSO( IsInternal ? nullptr : pPSO )
+ m_spPSO( IsInternal ? nullptr : pPSO ),
+ m_pPSO( pPSO )
{}
IMPLEMENT_QUERY_INTERFACE_IN_PLACE( IID_ShaderResourceBinding, TObjectBase )
diff --git a/Graphics/GraphicsEngine/include/StateObjectsRegistry.h b/Graphics/GraphicsEngine/include/StateObjectsRegistry.h
index 93e7bf82..2f735477 100644
--- a/Graphics/GraphicsEngine/include/StateObjectsRegistry.h
+++ b/Graphics/GraphicsEngine/include/StateObjectsRegistry.h
@@ -62,8 +62,8 @@ namespace Diligent
static constexpr int DeletedObjectsToPurge = 32;
StateObjectsRegistry(IMemoryAllocator &RawAllocator, const Char* RegistryName) :
- m_RegistryName( RegistryName ),
- m_DescToObjHashMap(STD_ALLOCATOR_RAW_MEM(HashMapElem, RawAllocator, "Allocator for unordered_map<ResourceDescType, RefCntWeakPtr<IDeviceObject> >") )
+ m_DescToObjHashMap(STD_ALLOCATOR_RAW_MEM(HashMapElem, RawAllocator, "Allocator for unordered_map<ResourceDescType, RefCntWeakPtr<IDeviceObject> >") ),
+ m_RegistryName( RegistryName )
{}
~StateObjectsRegistry()
diff --git a/Graphics/GraphicsEngine/interface/MapHelper.h b/Graphics/GraphicsEngine/interface/MapHelper.h
index ea1f0e28..527421de 100644
--- a/Graphics/GraphicsEngine/interface/MapHelper.h
+++ b/Graphics/GraphicsEngine/interface/MapHelper.h
@@ -49,10 +49,10 @@ class MapHelper
public:
/// Initializes the class member with null values
- MapHelper() :
- m_pMappedData(nullptr),
+ MapHelper() :
m_pBuffer(nullptr),
m_pContext(nullptr),
+ m_pMappedData(nullptr),
m_MapType(static_cast<MAP_TYPE>(-1)),
m_MapFlags(static_cast<Uint32>(-1))
{
diff --git a/Graphics/GraphicsEngine/interface/PipelineState.h b/Graphics/GraphicsEngine/interface/PipelineState.h
index dbb89660..0fa55d1e 100644
--- a/Graphics/GraphicsEngine/interface/PipelineState.h
+++ b/Graphics/GraphicsEngine/interface/PipelineState.h
@@ -89,19 +89,19 @@ struct SampleDesc
struct GraphicsPipelineDesc
{
/// Vertex shader to be used with the pipeline
- IShader *pVS;
+ IShader *pVS = nullptr;
/// Pixel shader to be used with the pipeline
- IShader *pPS;
+ IShader *pPS = nullptr;
/// Domain shader to be used with the pipeline
- IShader *pDS;
+ IShader *pDS = nullptr;
/// Hull shader to be used with the pipeline
- IShader *pHS;
+ IShader *pHS = nullptr;
/// Geometry shader to be used with the pipeline
- IShader *pGS;
+ IShader *pGS = nullptr;
//D3D12_STREAM_OUTPUT_DESC StreamOutput;
@@ -112,7 +112,7 @@ struct GraphicsPipelineDesc
/// in all the active render targets. A sample mask is always applied;
/// it is independent of whether multisampling is enabled, and does not
/// depend on whether an application uses multisample render targets.
- Uint32 SampleMask;
+ Uint32 SampleMask = 0xFFFFFFFF;
/// Rasterizer state description
RasterizerStateDesc RasterizerDesc;
@@ -125,10 +125,10 @@ struct GraphicsPipelineDesc
//D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue;
/// Primitive topology type
- PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType;
+ PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType = PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
/// Number of render targets in the RTVFormats member
- Uint32 NumRenderTargets;
+ Uint32 NumRenderTargets = 0;
/// Render target formats
TEXTURE_FORMAT RTVFormats[8];
@@ -140,21 +140,12 @@ struct GraphicsPipelineDesc
SampleDesc SmplDesc;
/// Node mask.
- Uint32 NodeMask;
+ Uint32 NodeMask = 0;
//D3D12_CACHED_PIPELINE_STATE CachedPSO;
//D3D12_PIPELINE_STATE_FLAGS Flags;
- GraphicsPipelineDesc() :
- pVS(nullptr),
- pPS(nullptr),
- pDS(nullptr),
- pHS(nullptr),
- pGS(nullptr),
- PrimitiveTopologyType(PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE),
- SampleMask(0xFFFFFFFF),
- NumRenderTargets(0),
- NodeMask(0)
+ GraphicsPipelineDesc()
{
for(size_t rt = 0; rt < _countof(RTVFormats); ++rt)
RTVFormats[rt] = TEX_FORMAT_UNKNOWN;