diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-11-30 06:40:42 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-11-30 06:40:42 +0000 |
| commit | 34cab1f1c50047f2a82cbb2656921c2d88e39ee7 (patch) | |
| tree | 9c520570008618d81bc4cba9a3aa5dd9455ba714 /Graphics/GraphicsEngineD3D12 | |
| parent | Improved const-correctness; updated comments; added DRAW_FLAG_VERIFY_STATES a... (diff) | |
| download | DiligentCore-34cab1f1c50047f2a82cbb2656921c2d88e39ee7.tar.gz DiligentCore-34cab1f1c50047f2a82cbb2656921c2d88e39ee7.zip | |
Improved type safety of different flag types
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
3 files changed, 11 insertions, 11 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h index 23fd4a93..142ca7cb 100644 --- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h @@ -60,13 +60,13 @@ public: virtual void TransitionShaderResources(IPipelineState *pPipelineState, IShaderResourceBinding *pShaderResourceBinding)override final; - virtual void CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags)override final; + virtual void CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags)override final; virtual void SetStencilRef(Uint32 StencilRef)override final; virtual void SetBlendFactors(const float* pBlendFactors = nullptr)override final; - virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, Uint32 Flags )override final; + virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, SET_VERTEX_BUFFERS_FLAGS Flags )override final; virtual void InvalidateState()override final; @@ -82,7 +82,7 @@ public: virtual void DispatchCompute( const DispatchComputeAttribs &DispatchAttrs )override final; - virtual void ClearDepthStencil( ITextureView *pView, Uint32 ClearFlags, float fDepth, Uint8 Stencil)override final; + virtual void ClearDepthStencil( ITextureView *pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil)override final; virtual void ClearRenderTarget( ITextureView *pView, const float *RGBA )override final; @@ -92,7 +92,7 @@ public: virtual void CopyBuffer(IBuffer *pSrcBuffer, Uint32 SrcOffset, IBuffer *pDstBuffer, Uint32 DstOffset, Uint32 Size)override final; - virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, Uint32 MapFlags, PVoid& pMappedData)override final; + virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData)override final; virtual void UnmapBuffer(IBuffer* pBuffer)override final; @@ -113,7 +113,7 @@ public: Uint32 MipLevel, Uint32 ArraySlice, MAP_TYPE MapType, - Uint32 MapFlags, + MAP_FLAGS MapFlags, const Box* pMapRegion, MappedTextureSubresource& MappedData )override final; diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 2a9f5aa6..f37691ac 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -232,7 +232,7 @@ namespace Diligent pPipelineStateD3D12->CommitAndTransitionShaderResources(pShaderResourceBinding, Ctx, false, true, false); } - void DeviceContextD3D12Impl::CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags) + void DeviceContextD3D12Impl::CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags) { if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/)) return; @@ -585,7 +585,7 @@ namespace Diligent ++m_State.NumCommands; } - void DeviceContextD3D12Impl::ClearDepthStencil( ITextureView* pView, Uint32 ClearFlags, float fDepth, Uint8 Stencil ) + void DeviceContextD3D12Impl::ClearDepthStencil( ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil ) { ITextureViewD3D12 *pDSVD3D12 = nullptr; if( pView != nullptr ) @@ -724,7 +724,7 @@ namespace Diligent EndFrame(*m_pDevice.RawPtr<RenderDeviceD3D12Impl>()); } - void DeviceContextD3D12Impl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, Uint32* pOffsets, Uint32 Flags ) + void DeviceContextD3D12Impl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, Uint32* pOffsets, SET_VERTEX_BUFFERS_FLAGS Flags ) { TDeviceContextBase::SetVertexBuffers( StartSlot, NumBuffersSet, ppBuffers, pOffsets, Flags ); m_State.bCommittedD3D12VBsUpToDate = false; @@ -948,7 +948,7 @@ namespace Diligent ++m_State.NumCommands; } - void DeviceContextD3D12Impl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, Uint32 MapFlags, PVoid& pMappedData) + void DeviceContextD3D12Impl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData) { TDeviceContextBase::MapBuffer(pBuffer, MapType, MapFlags, pMappedData); auto* pBufferD3D12 = ValidatedCast<BufferD3D12Impl>(pBuffer); @@ -1338,7 +1338,7 @@ namespace Diligent Uint32 MipLevel, Uint32 ArraySlice, MAP_TYPE MapType, - Uint32 MapFlags, + MAP_FLAGS MapFlags, const Box* pMapRegion, MappedTextureSubresource& MappedData ) { diff --git a/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp index cdc89e94..173049cc 100644 --- a/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp @@ -308,7 +308,7 @@ static TextureDesc InitTexDescFromD3D12Resource(ID3D12Resource* pTexture, const TexDesc.SampleCount = ResourceDesc.SampleDesc.Count; TexDesc.Usage = USAGE_DEFAULT; - TexDesc.BindFlags = 0; + TexDesc.BindFlags = BIND_NONE; if( (ResourceDesc.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) != 0 ) TexDesc.BindFlags |= BIND_RENDER_TARGET; if( (ResourceDesc.Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) != 0 ) |
