summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-11-30 06:40:42 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-11-30 06:40:42 +0000
commit34cab1f1c50047f2a82cbb2656921c2d88e39ee7 (patch)
tree9c520570008618d81bc4cba9a3aa5dd9455ba714 /Graphics
parentImproved const-correctness; updated comments; added DRAW_FLAG_VERIFY_STATES a... (diff)
downloadDiligentCore-34cab1f1c50047f2a82cbb2656921c2d88e39ee7.tar.gz
DiligentCore-34cab1f1c50047f2a82cbb2656921c2d88e39ee7.zip
Improved type safety of different flag types
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngine/include/DeviceContextBase.h18
-rw-r--r--Graphics/GraphicsEngine/interface/Buffer.h6
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceContext.h56
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h18
-rw-r--r--Graphics/GraphicsEngine/interface/MapHelper.h4
-rw-r--r--Graphics/GraphicsEngine/interface/Texture.h10
-rw-r--r--Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h38
-rwxr-xr-xGraphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h10
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp10
-rw-r--r--Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp4
-rw-r--r--Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h10
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp10
-rw-r--r--Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h10
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp10
-rw-r--r--Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h10
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp10
-rw-r--r--Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp2
-rw-r--r--Graphics/GraphicsTools/include/GraphicsUtilities.h2
-rw-r--r--Graphics/GraphicsTools/src/GraphicsUtilities.cpp4
20 files changed, 132 insertions, 112 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h
index ad012626..293e438c 100644
--- a/Graphics/GraphicsEngine/include/DeviceContextBase.h
+++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h
@@ -89,12 +89,12 @@ public:
/// Base implementation of IDeviceContext::SetVertexBuffers(); validates parameters and
/// caches references to the buffers.
- inline virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, Uint32* pOffsets, Uint32 Flags )override = 0;
+ inline virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, Uint32* pOffsets, SET_VERTEX_BUFFERS_FLAGS Flags )override = 0;
inline virtual void InvalidateState()override = 0;
/// Base implementation of IDeviceContext::CommitShaderResources(); validates parameters.
- inline bool CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags, int);
+ inline bool CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags, int);
/// Base implementation of IDeviceContext::SetIndexBuffer(); caches the strong reference to the index buffer
inline virtual void SetIndexBuffer( IBuffer* pIndexBuffer, Uint32 ByteOffset )override = 0;
@@ -116,7 +116,7 @@ public:
virtual void CopyBuffer(IBuffer *pSrcBuffer, Uint32 SrcOffset, IBuffer *pDstBuffer, Uint32 DstOffset, Uint32 Size)override = 0;
/// Base implementation of IDeviceContext::MapBuffer(); validates input parameters.
- virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, Uint32 MapFlags, PVoid& pMappedData)override = 0;
+ virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData)override = 0;
/// Base implementation of IDeviceContext::UnmapBuffer()
virtual void UnmapBuffer(IBuffer* pBuffer)override = 0;
@@ -141,7 +141,7 @@ public:
Uint32 MipLevel,
Uint32 ArraySlice,
MAP_TYPE MapType,
- Uint32 MapFlags,
+ MAP_FLAGS MapFlags,
const Box* pMapRegion,
MappedTextureSubresource& MappedData)override = 0;
@@ -257,7 +257,8 @@ protected:
template<typename BaseInterface, typename BufferImplType, typename TextureViewImplType, typename PipelineStateImplType>
-inline void DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType, PipelineStateImplType> :: SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, Uint32* pOffsets, Uint32 Flags )
+inline void DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType, PipelineStateImplType> ::
+ SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, Uint32* pOffsets, SET_VERTEX_BUFFERS_FLAGS Flags )
{
#ifdef DEVELOPMENT
if ( StartSlot >= MaxBufferSlots )
@@ -314,7 +315,8 @@ inline void DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType
}
template<typename BaseInterface, typename BufferImplType, typename TextureViewImplType, typename PipelineStateImplType>
-inline bool DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType, PipelineStateImplType> :: CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags, int)
+inline bool DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType, PipelineStateImplType> ::
+ CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags, int)
{
#ifdef DEVELOPMENT
if (!m_pPipelineState)
@@ -695,7 +697,7 @@ inline void DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType
template<typename BaseInterface, typename BufferImplType, typename TextureViewImplType, typename PipelineStateImplType>
inline void DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType, PipelineStateImplType> ::
- MapBuffer( IBuffer* pBuffer, MAP_TYPE MapType, Uint32 MapFlags, PVoid& pMappedData )
+ MapBuffer( IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData )
{
VERIFY(pBuffer, "pBuffer must not be null");
@@ -779,7 +781,7 @@ inline void DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType
Uint32 MipLevel,
Uint32 ArraySlice,
MAP_TYPE MapType,
- Uint32 MapFlags,
+ MAP_FLAGS MapFlags,
const Box* pMapRegion,
MappedTextureSubresource& MappedData)
{
diff --git a/Graphics/GraphicsEngine/interface/Buffer.h b/Graphics/GraphicsEngine/interface/Buffer.h
index d8ba656d..b192d18a 100644
--- a/Graphics/GraphicsEngine/interface/Buffer.h
+++ b/Graphics/GraphicsEngine/interface/Buffer.h
@@ -75,14 +75,14 @@ struct BufferDesc : DeviceObjectAttribs
/// Diligent::BIND_VERTEX_BUFFER, Diligent::BIND_INDEX_BUFFER, Diligent::BIND_UNIFORM_BUFFER,
/// Diligent::BIND_SHADER_RESOURCE, Diligent::BIND_STREAM_OUTPUT, Diligent::BIND_UNORDERED_ACCESS,
/// Diligent::BIND_INDIRECT_DRAW_ARGS
- Uint32 BindFlags = 0;
+ BIND_FLAGS BindFlags = BIND_NONE;
/// Buffer usage, see Diligent::USAGE for details
USAGE Usage = USAGE_DEFAULT;
/// CPU access flags or 0 if no CPU access is allowed,
- /// see Diligent::CPU_ACCESS_FLAG for details.
- Uint8 CPUAccessFlags = 0;
+ /// see Diligent::CPU_ACCESS_FLAGS for details.
+ CPU_ACCESS_FLAGS CPUAccessFlags = CPU_ACCESS_NONE;
/// Buffer mode, see Diligent::BUFFER_MODE
BUFFER_MODE Mode = BUFFER_MODE_UNDEFINED;
diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h
index 60898af7..70088d2a 100644
--- a/Graphics/GraphicsEngine/interface/DeviceContext.h
+++ b/Graphics/GraphicsEngine/interface/DeviceContext.h
@@ -27,6 +27,7 @@
/// Definition of the Diligent::IDeviceContext interface and related data structures
#include "../../../Primitives/interface/Object.h"
+#include "../../../Primitives/interface/FlagEnum.h"
#include "DeviceCaps.h"
#include "Constants.h"
#include "Buffer.h"
@@ -57,15 +58,15 @@ enum DRAW_FLAGS : Uint8
/// Perform no state transitions
DRAW_FLAG_NONE = 0x00,
- /// Transition vertex buffers to RESOURCE_STATE_VERTEX_BUFFER state (see Diligent::RESOURCE_STATE).
+ /// Transition vertex buffers to Diligent::RESOURCE_STATE_VERTEX_BUFFER state (see Diligent::RESOURCE_STATE).
/// Vertex buffers in unknown state will not be transitioned.
DRAW_FLAG_TRANSITION_VERTEX_BUFFERS = 0x01,
- /// Transition index buffer to RESOURCE_STATE_INDEX_BUFFER state (see Diligent::RESOURCE_STATE).
+ /// Transition index buffer to Diligent::RESOURCE_STATE_INDEX_BUFFER state (see Diligent::RESOURCE_STATE).
/// If the index buffer is in unknown state, this flag has no effect.
DRAW_FLAG_TRANSITION_INDEX_BUFFER = 0x02,
- /// Transition indirect draw arguments buffer to RESOURCE_STATE_INDIRECT_ARGUMENT state (see Diligent::RESOURCE_STATE).
+ /// Transition indirect draw arguments buffer to Diligent::RESOURCE_STATE_INDIRECT_ARGUMENT state (see Diligent::RESOURCE_STATE).
/// If the buffer is in unknown state, this flag has no effect.
DRAW_FLAG_TRANSITION_INDIRECT_ARGS_BUFFER = 0x04,
@@ -78,6 +79,7 @@ enum DRAW_FLAGS : Uint8
/// application explicitly manages the states.
DRAW_FLAG_VERIFY_STATES = 0x08
};
+DEFINE_FLAG_ENUM_OPERATORS(DRAW_FLAGS)
/// Defines the draw command attributes
@@ -101,7 +103,7 @@ struct DrawAttribs
VALUE_TYPE IndexType = VT_UNDEFINED;
/// Additional flags controlling the draw command behavior, see Diligent::DRAW_FLAGS.
- Uint8 Flags = DRAW_FLAG_NONE;
+ DRAW_FLAGS Flags = DRAW_FLAG_NONE;
/// Number of instances to draw. If more than one instance is specified,
/// instanced draw call will be performed.
@@ -155,12 +157,13 @@ struct DrawAttribs
/// Defines which parts of the depth-stencil buffer to clear.
/// These flags are used by IDeviceContext::ClearDepthStencil().
-enum CLEAR_DEPTH_STENCIL_FLAGS : Int32
+enum CLEAR_DEPTH_STENCIL_FLAGS : Uint32
{
- CLEAR_DEPTH_FLAG = 0x01, ///< Clear depth part of the buffer
- CLEAR_STENCIL_FLAG = 0x02 ///< Clear stencil part of the buffer
+ CLEAR_DEPTH_FLAG_NONE = 0x00, ///< Perform no clear
+ CLEAR_DEPTH_FLAG = 0x01, ///< Clear depth part of the buffer
+ CLEAR_STENCIL_FLAG = 0x02 ///< Clear stencil part of the buffer
};
-
+DEFINE_FLAG_ENUM_OPERATORS(CLEAR_DEPTH_STENCIL_FLAGS)
/// Dispatch compute command flags
enum DISPATCH_FLAGS : Uint8
@@ -177,6 +180,7 @@ enum DISPATCH_FLAGS : Uint8
/// flag has no effect in release build.
DISPATCH_FLAG_VERIFY_STATES = 0x02
};
+DEFINE_FLAG_ENUM_OPERATORS(DISPATCH_FLAGS)
/// Describes dispatch command arguments.
@@ -199,7 +203,7 @@ struct DispatchComputeAttribs
Uint32 DispatchArgsByteOffset;
/// Flags controlling the dispatch command behavior, see Diligent::DISPATCH_FLAGS.
- Uint8 Flags = DISPATCH_FLAG_FLAG_NONE;
+ DISPATCH_FLAGS Flags = DISPATCH_FLAG_FLAG_NONE;
/// Initializes the structure to perform non-indirect dispatch command
@@ -231,16 +235,23 @@ struct DispatchComputeAttribs
};
/// Defines allowed flags for IDeviceContext::SetVertexBuffers() function.
-enum SET_VERTEX_BUFFERS_FLAGS : Int32
+enum SET_VERTEX_BUFFERS_FLAGS : Uint8
{
+ /// No extra operations
+ SET_VERTEX_BUFFERS_FLAG_NONE = 0x00,
+
/// Reset the vertex buffers to only the buffers specified in this
/// call. All buffers previously bound to the pipeline will be unbound.
SET_VERTEX_BUFFERS_FLAG_RESET = 0x01
};
+DEFINE_FLAG_ENUM_OPERATORS(SET_VERTEX_BUFFERS_FLAGS)
/// Defines allowed flags for IDeviceContext::CommitShaderResources() function.
-enum COMMIT_SHADER_RESOURCES_FLAG
+enum COMMIT_SHADER_RESOURCES_FLAGS : Uint8
{
+ /// Perform no extra operations
+ COMMIT_SHADER_RESOURCES_FLAG_NONE = 0x00,
+
/// Transition resources being committed
/// If this flag is specified when IDeviceContext::CommitShaderResources() is called,
@@ -254,8 +265,9 @@ enum COMMIT_SHADER_RESOURCES_FLAG
/// that all resources are transitioned to correct states when
/// COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES flag is not set.
/// No resource state validation is performed in release build.
- COMMIT_SHADER_RESOURCES_FLAG_VERIFY_STATES = 0x02
+ COMMIT_SHADER_RESOURCES_FLAG_VERIFY_STATES = 0x02
};
+DEFINE_FLAG_ENUM_OPERATORS(COMMIT_SHADER_RESOURCES_FLAGS)
/// Describes the viewport.
@@ -363,7 +375,7 @@ public:
/// \param [in] pShaderResourceBinding - Shader resource binding whose resources will be committed.
/// If pipeline state contains no shader resources, this parameter
/// can be null.
- /// \param [in] Flags - Additional flags for the operation. See Diligent::COMMIT_SHADER_RESOURCES_FLAG
+ /// \param [in] Flags - Additional flags for the operation. See Diligent::COMMIT_SHADER_RESOURCES_FLAGS
/// for a list of allowed values.
///
/// \remarks Pipeline state object that was used to create the shader resource binding must be bound
@@ -399,7 +411,7 @@ public:
/// manually by setting the state to Diligent::RESOURCE_STATE_UNKNOWN (which will disable automatic state
/// management) using IBuffer::SetState() or ITexture::SetState() and explicitly transitioning the states with
/// IDeviceContext::TransitionResourceStates(). See IDeviceContext::TransitionResourceStates() for details.
- virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags) = 0;
+ virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags) = 0;
/// Sets the stencil reference value
@@ -435,11 +447,11 @@ public:
/// It is suggested to specify Diligent::SET_VERTEX_BUFFERS_FLAG_RESET flag
/// whenever possible. This will assure that no buffers from previous draw calls are
/// are bound to the pipeline.
- virtual void SetVertexBuffers(Uint32 StartSlot,
- Uint32 NumBuffersSet,
- IBuffer** ppBuffers,
- Uint32* pOffsets,
- Uint32 Flags) = 0;
+ virtual void SetVertexBuffers(Uint32 StartSlot,
+ Uint32 NumBuffersSet,
+ IBuffer** ppBuffers,
+ Uint32* pOffsets,
+ SET_VERTEX_BUFFERS_FLAGS Flags) = 0;
/// Invalidates the cached context state.
@@ -551,7 +563,7 @@ public:
/// \param [in] Stencil - Value to clear stencil part of the view with.
/// \remarks The full extent of the view is always cleared. Viewport and scissor settings are not applied.
/// \note The depth-stencil view must be bound to the pipeline for clear operation to be performed.
- virtual void ClearDepthStencil(ITextureView* pView, Uint32 ClearFlags = CLEAR_DEPTH_FLAG, float fDepth = 1.f, Uint8 Stencil = 0) = 0;
+ virtual void ClearDepthStencil(ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags = CLEAR_DEPTH_FLAG, float fDepth = 1.f, Uint8 Stencil = 0) = 0;
/// Clears a render target view
@@ -614,7 +626,7 @@ public:
/// \param [in] MapType - Type of the map operation. See Diligent::MAP_TYPE.
/// \param [in] MapFlags - Special map flags. See Diligent::MAP_FLAGS.
/// \param [out] pMappedData - Reference to the void pointer to store the address of the mapped region.
- virtual void MapBuffer( IBuffer* pBuffer, MAP_TYPE MapType, Uint32 MapFlags, PVoid &pMappedData ) = 0;
+ virtual void MapBuffer( IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid &pMappedData ) = 0;
/// Unmaps the previously mapped buffer
@@ -680,7 +692,7 @@ public:
Uint32 MipLevel,
Uint32 ArraySlice,
MAP_TYPE MapType,
- Uint32 MapFlags,
+ MAP_FLAGS MapFlags,
const Box* pMapRegion,
MappedTextureSubresource& MappedData ) = 0;
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index b542bde9..b9344120 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -28,6 +28,7 @@
#include "../../../Primitives/interface/BasicTypes.h"
#include "../../../Primitives/interface/DebugOutput.h"
+#include "../../../Primitives/interface/FlagEnum.h"
/// Graphics engine namespace
namespace Diligent
@@ -77,6 +78,7 @@ namespace Diligent
BIND_UNORDERED_ACCESS = 0x80L,///< A buffer or a texture can be bound as an unordered access view
BIND_INDIRECT_DRAW_ARGS = 0x100L///< A buffer can be bound as the source buffer for indirect draw commands
};
+ DEFINE_FLAG_ENUM_OPERATORS(BIND_FLAGS)
/// Resource usage
@@ -113,11 +115,13 @@ namespace Diligent
/// - BufferDesc to describe CPU access mode for a buffer
/// - TextureDesc to describe CPU access mode for a texture
/// \note Only USAGE_DYNAMIC resources can be mapped
- enum CPU_ACCESS_FLAG : Uint8
+ enum CPU_ACCESS_FLAGS : Uint8
{
- CPU_ACCESS_READ = 0x01, ///< A resource can be mapped for reading
- CPU_ACCESS_WRITE = 0x02 ///< A resource can be mapped for writing
+ CPU_ACCESS_NONE = 0x00, ///< No CPU access
+ CPU_ACCESS_READ = 0x01, ///< A resource can be mapped for reading
+ CPU_ACCESS_WRITE = 0x02 ///< A resource can be mapped for writing
};
+ DEFINE_FLAG_ENUM_OPERATORS(CPU_ACCESS_FLAGS)
/// Resource mapping type
@@ -149,6 +153,8 @@ namespace Diligent
/// - ITexture::Map to describe texture mapping flags
enum MAP_FLAGS : Uint8
{
+ MAP_FLAG_NONE = 0x000,
+
/// Specifies that map operation should not wait until previous command that
/// using the same resource completes. Map returns null pointer if the resource
/// is still in use.\n
@@ -167,6 +173,7 @@ namespace Diligent
/// D3D11 counterpart: D3D11_MAP_WRITE_NO_OVERWRITE. OpenGL counterpart: GL_MAP_UNSYNCHRONIZED_BIT
MAP_FLAG_DO_NOT_SYNCHRONIZE = 0x004
};
+ DEFINE_FLAG_ENUM_OPERATORS(MAP_FLAGS)
/// Describes resource dimension
@@ -892,13 +899,16 @@ namespace Diligent
/// Miscellaneous texture flags
/// The enumeration is used by TextureDesc to describe misc texture flags
- enum MISC_TEXTURE_FLAG : Uint8
+ enum MISC_TEXTURE_FLAGS : Uint8
{
+ MISC_TEXTURE_FLAG_NONE = 0x00,
+
/// Allow automatic mipmap generation with ITextureView::GenerateMips()
/// \note A texture must be created with BIND_RENDER_TARGET bind flag
MISC_TEXTURE_FLAG_GENERATE_MIPS = 0x01
};
+ DEFINE_FLAG_ENUM_OPERATORS(MISC_TEXTURE_FLAGS)
/// Input primitive topology.
diff --git a/Graphics/GraphicsEngine/interface/MapHelper.h b/Graphics/GraphicsEngine/interface/MapHelper.h
index aae341c5..71264c3b 100644
--- a/Graphics/GraphicsEngine/interface/MapHelper.h
+++ b/Graphics/GraphicsEngine/interface/MapHelper.h
@@ -63,7 +63,7 @@ public:
/// Initializes the object and maps the provided resource.
/// See Map() for details.
- MapHelper( IDeviceContext *pContext, IBuffer *pBuffer, MAP_TYPE MapType, Uint32 MapFlags ) :
+ MapHelper( IDeviceContext *pContext, IBuffer *pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags ) :
MapHelper()
{
Map(pContext, pBuffer, MapType, MapFlags);
@@ -106,7 +106,7 @@ public:
/// \param pBuffer - Pointer to the buffer interface to map.
/// \param MapType - Type of the map operation, see Diligent::MAP_TYPE for details.
/// \param MapFlags - Additional map flags, see Diligent::MAP_FLAGS.
- void Map( IDeviceContext *pContext, IBuffer *pBuffer, MAP_TYPE MapType, Uint32 MapFlags )
+ void Map( IDeviceContext *pContext, IBuffer *pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags )
{
VERIFY(!m_pBuffer && !m_pMappedData && !m_pContext, "Object already mapped");
Unmap();
diff --git a/Graphics/GraphicsEngine/interface/Texture.h b/Graphics/GraphicsEngine/interface/Texture.h
index b8c84409..aad67467 100644
--- a/Graphics/GraphicsEngine/interface/Texture.h
+++ b/Graphics/GraphicsEngine/interface/Texture.h
@@ -119,14 +119,14 @@ struct TextureDesc : DeviceObjectAttribs
/// Diligent::BIND_SHADER_RESOURCE, Diligent::BIND_RENDER_TARGET, Diligent::BIND_DEPTH_STENCIL,
/// Diligent::and BIND_UNORDERED_ACCESS. \n
/// Multisampled textures cannot have Diligent::BIND_UNORDERED_ACCESS flag set
- Uint32 BindFlags = 0;
+ BIND_FLAGS BindFlags = BIND_NONE;
/// CPU access flags or 0 if no CPU access is allowed,
- /// see Diligent::CPU_ACCESS_FLAG for details.
- Uint32 CPUAccessFlags = 0;
+ /// see Diligent::CPU_ACCESS_FLAGS for details.
+ CPU_ACCESS_FLAGS CPUAccessFlags = CPU_ACCESS_NONE;
- /// Miscellaneous flags, see Diligent::MISC_TEXTURE_FLAG for details.
- Uint32 MiscFlags = 0;
+ /// Miscellaneous flags, see Diligent::MISC_TEXTURE_FLAGS for details.
+ MISC_TEXTURE_FLAGS MiscFlags = MISC_TEXTURE_FLAG_NONE;
/// Optimized clear value
OptimizedClearValue ClearValue;
diff --git a/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h b/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h
index a8571222..a2800d00 100644
--- a/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h
+++ b/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h
@@ -46,17 +46,17 @@ inline UINT BindFlagsToD3D11BindFlags(Uint32 BindFlags)
return D3D11BindFlags;
}
-inline Uint32 D3D11BindFlagsToBindFlags(UINT D3D11BindFlags)
+inline BIND_FLAGS D3D11BindFlagsToBindFlags(UINT D3D11BindFlags)
{
- Uint32 BindFlags = 0;
- BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_VERTEX_BUFFER) ? BIND_VERTEX_BUFFER : 0);
- BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_INDEX_BUFFER) ? BIND_INDEX_BUFFER : 0);
- BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_CONSTANT_BUFFER) ? BIND_UNIFORM_BUFFER : 0);
- BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_SHADER_RESOURCE) ? BIND_SHADER_RESOURCE : 0);
- BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_STREAM_OUTPUT) ? BIND_STREAM_OUTPUT : 0);
- BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_RENDER_TARGET) ? BIND_RENDER_TARGET : 0);
- BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_DEPTH_STENCIL) ? BIND_DEPTH_STENCIL : 0);
- BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_UNORDERED_ACCESS) ? BIND_UNORDERED_ACCESS : 0);
+ BIND_FLAGS BindFlags = BIND_NONE;
+ BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_VERTEX_BUFFER) ? BIND_VERTEX_BUFFER : BIND_NONE);
+ BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_INDEX_BUFFER) ? BIND_INDEX_BUFFER : BIND_NONE);
+ BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_CONSTANT_BUFFER) ? BIND_UNIFORM_BUFFER : BIND_NONE);
+ BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_SHADER_RESOURCE) ? BIND_SHADER_RESOURCE : BIND_NONE);
+ BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_STREAM_OUTPUT) ? BIND_STREAM_OUTPUT : BIND_NONE);
+ BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_RENDER_TARGET) ? BIND_RENDER_TARGET : BIND_NONE);
+ BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_DEPTH_STENCIL) ? BIND_DEPTH_STENCIL : BIND_NONE);
+ BindFlags = BindFlags | ((D3D11BindFlags & D3D11_BIND_UNORDERED_ACCESS) ? BIND_UNORDERED_ACCESS : BIND_NONE);
VERIFY_EXPR( (D3D11BindFlags &
(D3D11_BIND_VERTEX_BUFFER|D3D11_BIND_INDEX_BUFFER|D3D11_BIND_CONSTANT_BUFFER|
D3D11_BIND_SHADER_RESOURCE|D3D11_BIND_STREAM_OUTPUT|D3D11_BIND_RENDER_TARGET|
@@ -120,10 +120,6 @@ inline void MapParamsToD3D11MapParams(MAP_TYPE MapType, Uint32 MapFlags, D3D11_M
d3d11MapFlags |= (MapFlags & MAP_FLAG_DO_NOT_WAIT) ? D3D11_MAP_FLAG_DO_NOT_WAIT : 0;
}
-inline UINT MapFlagsToD3D11MapFlags(Uint32 MapFlags)
-{
-}
-
inline UINT CPUAccessFlagsToD3D11CPUAccessFlags(Uint32 Flags)
{
UINT D3D11CPUAccessFlags = 0;
@@ -132,11 +128,11 @@ inline UINT CPUAccessFlagsToD3D11CPUAccessFlags(Uint32 Flags)
return D3D11CPUAccessFlags;
}
-inline Uint8 D3D11CPUAccessFlagsToCPUAccessFlags(UINT D3D11CPUAccessFlags)
+inline CPU_ACCESS_FLAGS D3D11CPUAccessFlagsToCPUAccessFlags(UINT D3D11CPUAccessFlags)
{
- Uint8 CPUAccessFlags = 0;
- CPUAccessFlags |= (D3D11CPUAccessFlags & D3D11_CPU_ACCESS_READ) ? CPU_ACCESS_READ : 0;
- CPUAccessFlags |= (D3D11CPUAccessFlags & D3D11_CPU_ACCESS_WRITE) ? CPU_ACCESS_WRITE : 0;
+ CPU_ACCESS_FLAGS CPUAccessFlags = CPU_ACCESS_NONE;
+ CPUAccessFlags |= (D3D11CPUAccessFlags & D3D11_CPU_ACCESS_READ) ? CPU_ACCESS_READ : CPU_ACCESS_NONE;
+ CPUAccessFlags |= (D3D11CPUAccessFlags & D3D11_CPU_ACCESS_WRITE) ? CPU_ACCESS_WRITE : CPU_ACCESS_NONE;
VERIFY_EXPR(D3D11CPUAccessFlags == CPUAccessFlagsToD3D11CPUAccessFlags(CPUAccessFlags));
return CPUAccessFlags;
}
@@ -148,10 +144,10 @@ inline UINT MiscTextureFlagsToD3D11Flags(Uint32 Flags)
return D3D11MiscFlags;
}
-inline Uint32 D3D11MiscFlagsToMiscTextureFlags(UINT D3D11MiscFlags)
+inline MISC_TEXTURE_FLAGS D3D11MiscFlagsToMiscTextureFlags(UINT D3D11MiscFlags)
{
- Uint32 MiscFlags = 0;
- MiscFlags |= (D3D11MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS) ? MISC_TEXTURE_FLAG_GENERATE_MIPS : 0;
+ MISC_TEXTURE_FLAGS MiscFlags = MISC_TEXTURE_FLAG_NONE;
+ MiscFlags |= (D3D11MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS) ? MISC_TEXTURE_FLAG_GENERATE_MIPS : MISC_TEXTURE_FLAG_NONE;
return MiscFlags;
}
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
index a21630a8..08bdd7a0 100755
--- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
@@ -58,13 +58,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;
@@ -80,7 +80,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;
@@ -90,7 +90,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;
@@ -111,7 +111,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/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 2d6d14d1..c07912e3 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -617,7 +617,7 @@ namespace Diligent
TransitionAndCommitShaderResources<true, false>(pPipelineState, pShaderResourceBinding, false);
}
- void DeviceContextD3D11Impl::CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags)
+ void DeviceContextD3D11Impl::CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags)
{
if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/))
return;
@@ -872,7 +872,7 @@ namespace Diligent
m_pd3d11DeviceContext->Dispatch( DispatchAttrs.ThreadGroupCountX, DispatchAttrs.ThreadGroupCountY, DispatchAttrs.ThreadGroupCountZ );
}
- void DeviceContextD3D11Impl::ClearDepthStencil( ITextureView* pView, Uint32 ClearFlags, float fDepth, Uint8 Stencil )
+ void DeviceContextD3D11Impl::ClearDepthStencil( ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil )
{
if (pView == nullptr)
{
@@ -973,7 +973,7 @@ namespace Diligent
}
- void DeviceContextD3D11Impl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, Uint32 MapFlags, PVoid& pMappedData)
+ void DeviceContextD3D11Impl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData)
{
TDeviceContextBase::MapBuffer(pBuffer, MapType, MapFlags, pMappedData);
@@ -1076,7 +1076,7 @@ namespace Diligent
Uint32 MipLevel,
Uint32 ArraySlice,
MAP_TYPE MapType,
- Uint32 MapFlags,
+ MAP_FLAGS MapFlags,
const Box* pMapRegion,
MappedTextureSubresource& MappedData )
{
@@ -1126,7 +1126,7 @@ namespace Diligent
{
}
- void DeviceContextD3D11Impl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32* pOffsets, Uint32 Flags )
+ void DeviceContextD3D11Impl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32* pOffsets, SET_VERTEX_BUFFERS_FLAGS Flags )
{
TDeviceContextBase::SetVertexBuffers( StartSlot, NumBuffersSet, ppBuffers, pOffsets, Flags );
m_bCommittedD3D11VBsUpToDate = false;
diff --git a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
index e37584ad..cb25af84 100644
--- a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
@@ -86,8 +86,8 @@ void SwapChainD3D11Impl::CreateRTVandDSV()
DepthBufferDesc.SampleCount = m_SwapChainDesc.SamplesCount;
DepthBufferDesc.Usage = USAGE_DEFAULT;
DepthBufferDesc.BindFlags = BIND_DEPTH_STENCIL;
- DepthBufferDesc.CPUAccessFlags = 0;
- DepthBufferDesc.MiscFlags = 0;
+ DepthBufferDesc.CPUAccessFlags = CPU_ACCESS_NONE;
+ DepthBufferDesc.MiscFlags = MISC_TEXTURE_FLAG_NONE;
RefCntAutoPtr<ITexture> ptex2DDepthBuffer;
m_pRenderDevice->CreateTexture(DepthBufferDesc, TextureData{}, &ptex2DDepthBuffer);
auto pDSV = ptex2DDepthBuffer->GetDefaultView(TEXTURE_VIEW_DEPTH_STENCIL);
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 )
diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
index 96d7840d..fe4afb36 100644
--- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
@@ -50,13 +50,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;
@@ -72,7 +72,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;
@@ -82,7 +82,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;
@@ -103,7 +103,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/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
index 1687316d..872e9f0f 100644
--- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
@@ -130,7 +130,7 @@ namespace Diligent
}
- void DeviceContextGLImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags)
+ void DeviceContextGLImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags)
{
if(!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0))
return;
@@ -161,7 +161,7 @@ namespace Diligent
}
}
- void DeviceContextGLImpl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, Uint32 Flags )
+ void DeviceContextGLImpl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, SET_VERTEX_BUFFERS_FLAGS Flags )
{
TDeviceContextBase::SetVertexBuffers( StartSlot, NumBuffersSet, ppBuffers, pOffsets, Flags );
m_bVAOIsUpToDate = false;
@@ -866,7 +866,7 @@ namespace Diligent
#endif
}
- void DeviceContextGLImpl::ClearDepthStencil( ITextureView *pView, Uint32 ClearFlags, float fDepth, Uint8 Stencil )
+ void DeviceContextGLImpl::ClearDepthStencil( ITextureView *pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil )
{
// Unlike OpenGL, in D3D10+, the full extent of the resource view is always cleared.
// Viewport and scissor settings are not applied.
@@ -1028,7 +1028,7 @@ namespace Diligent
pDstBufferGL->CopyData(m_ContextState, *pSrcBufferGL, SrcOffset, DstOffset, Size);
}
- void DeviceContextGLImpl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, Uint32 MapFlags, PVoid& pMappedData)
+ void DeviceContextGLImpl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData)
{
TDeviceContextBase::MapBuffer(pBuffer, MapType, MapFlags, pMappedData);
auto* pBufferGL = ValidatedCast<BufferGLImpl>(pBuffer);
@@ -1071,7 +1071,7 @@ namespace Diligent
Uint32 MipLevel,
Uint32 ArraySlice,
MAP_TYPE MapType,
- Uint32 MapFlags,
+ MAP_FLAGS MapFlags,
const Box* pMapRegion,
MappedTextureSubresource& MappedData )
{
diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
index a1d645af..8678f2af 100644
--- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
@@ -67,13 +67,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;
@@ -89,7 +89,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;
@@ -99,7 +99,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;
@@ -120,7 +120,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/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index de99f36f..b594aa35 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -263,7 +263,7 @@ namespace Diligent
pPipelineStateVk->CommitAndTransitionShaderResources(pShaderResourceBinding, this, false, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES, nullptr);
}
- void DeviceContextVkImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags)
+ void DeviceContextVkImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags)
{
if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/))
return;
@@ -636,7 +636,7 @@ namespace Diligent
++m_State.NumCommands;
}
- void DeviceContextVkImpl::ClearDepthStencil( ITextureView* pView, Uint32 ClearFlags, float fDepth, Uint8 Stencil )
+ void DeviceContextVkImpl::ClearDepthStencil( ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil )
{
ITextureViewVk* pVkDSV = nullptr;
if ( pView != nullptr )
@@ -968,7 +968,7 @@ namespace Diligent
m_pPipelineState = nullptr;
}
- void DeviceContextVkImpl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, Uint32 Flags )
+ void DeviceContextVkImpl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, SET_VERTEX_BUFFERS_FLAGS Flags )
{
TDeviceContextBase::SetVertexBuffers( StartSlot, NumBuffersSet, ppBuffers, pOffsets, Flags );
m_State.CommittedVBsUpToDate = false;
@@ -1292,7 +1292,7 @@ namespace Diligent
++m_State.NumCommands;
}
- void DeviceContextVkImpl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, Uint32 MapFlags, PVoid& pMappedData)
+ void DeviceContextVkImpl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData)
{
TDeviceContextBase::MapBuffer(pBuffer, MapType, MapFlags, pMappedData);
auto* pBufferVk = ValidatedCast<BufferVkImpl>(pBuffer);
@@ -1709,7 +1709,7 @@ namespace Diligent
Uint32 MipLevel,
Uint32 ArraySlice,
MAP_TYPE MapType,
- Uint32 MapFlags,
+ MAP_FLAGS MapFlags,
const Box* pMapRegion,
MappedTextureSubresource& MappedData )
{
diff --git a/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp b/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp
index 7fcc6b27..ec6d61c3 100644
--- a/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp
@@ -304,7 +304,7 @@ namespace Diligent
if (CurrLayout != VK_IMAGE_LAYOUT_GENERAL)
Ctx.TransitionImageLayout(*pTexVk, CurrLayout, VK_IMAGE_LAYOUT_GENERAL, SubresRange);
- Ctx.CommitShaderResources(&SRB, 0);
+ Ctx.CommitShaderResources(&SRB, COMMIT_SHADER_RESOURCES_FLAG_NONE);
DispatchComputeAttribs DispatchAttrs((DstWidth + 7) / 8, (DstHeight + 7) / 8, ViewDesc.NumArraySlices);
Ctx.DispatchCompute(DispatchAttrs);
diff --git a/Graphics/GraphicsTools/include/GraphicsUtilities.h b/Graphics/GraphicsTools/include/GraphicsUtilities.h
index 6f7b4361..bd56011a 100644
--- a/Graphics/GraphicsTools/include/GraphicsUtilities.h
+++ b/Graphics/GraphicsTools/include/GraphicsUtilities.h
@@ -32,6 +32,6 @@
namespace Diligent
{
-void CreateUniformBuffer( IRenderDevice *pDevice, Uint32 Size, const Char *Name, IBuffer **ppBuffer, USAGE Usage = USAGE_DYNAMIC, Uint32 BindFlag = BIND_UNIFORM_BUFFER, Uint8 CPUAccessFlags = CPU_ACCESS_WRITE );
+void CreateUniformBuffer( IRenderDevice *pDevice, Uint32 Size, const Char *Name, IBuffer **ppBuffer, USAGE Usage = USAGE_DYNAMIC, BIND_FLAGS BindFlag = BIND_UNIFORM_BUFFER, CPU_ACCESS_FLAGS CPUAccessFlags = CPU_ACCESS_WRITE );
void GenerateCheckerBoardPattern(Uint32 Width, Uint32 Height, TEXTURE_FORMAT Fmt, Uint32 HorzCells, Uint32 VertCells, Uint8 *pData, Uint32 StrideInBytes );
}
diff --git a/Graphics/GraphicsTools/src/GraphicsUtilities.cpp b/Graphics/GraphicsTools/src/GraphicsUtilities.cpp
index 2abbd9ce..8052d2b5 100644
--- a/Graphics/GraphicsTools/src/GraphicsUtilities.cpp
+++ b/Graphics/GraphicsTools/src/GraphicsUtilities.cpp
@@ -33,13 +33,13 @@
namespace Diligent
{
-void CreateUniformBuffer( IRenderDevice *pDevice, Uint32 Size, const Char *Name, IBuffer **ppBuffer, USAGE Usage, Uint32 BindFlag, Uint8 CPUAccessFlags)
+void CreateUniformBuffer( IRenderDevice *pDevice, Uint32 Size, const Char *Name, IBuffer **ppBuffer, USAGE Usage, BIND_FLAGS BindFlags, CPU_ACCESS_FLAGS CPUAccessFlags)
{
BufferDesc CBDesc;
CBDesc.Name = Name;
CBDesc.uiSizeInBytes = Size;
CBDesc.Usage = Usage;
- CBDesc.BindFlags = BindFlag;
+ CBDesc.BindFlags = BindFlags;
CBDesc.CPUAccessFlags = CPUAccessFlags;
pDevice->CreateBuffer( CBDesc, BufferData(), ppBuffer );
}