summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-01-25 19:19:23 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-01-25 19:19:23 +0000
commitd31dc00f82d2121dc0378db77264d9263540a192 (patch)
treed384eb65560a6bef42e339d4393e03b6c9baaa16 /Graphics/GraphicsEngineD3D11
parentUpdated handling of fatal errors (diff)
downloadDiligentCore-d31dc00f82d2121dc0378db77264d9263540a192.tar.gz
DiligentCore-d31dc00f82d2121dc0378db77264d9263540a192.zip
Reworked main headers to be compatible with c
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h6
-rw-r--r--Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h2
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp10
-rw-r--r--Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp8
-rw-r--r--Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp2
-rw-r--r--Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp4
7 files changed, 19 insertions, 19 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
index 68dfdab0..162a1285 100755
--- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
@@ -336,11 +336,11 @@ private:
/// There is no need to keep strong references because D3D11 device context
/// already does. Buffers cannot be destroyed while bound to the context.
/// We only mirror all bindings.
- ID3D11Buffer* m_CommittedD3D11VertexBuffers[MaxBufferSlots] = {};
+ ID3D11Buffer* m_CommittedD3D11VertexBuffers[MAX_BUFFER_SLOTS] = {};
/// An array of strides of committed vertex buffers
- UINT m_CommittedD3D11VBStrides[MaxBufferSlots] = {};
+ UINT m_CommittedD3D11VBStrides[MAX_BUFFER_SLOTS] = {};
/// An array of offsets of committed vertex buffers
- UINT m_CommittedD3D11VBOffsets[MaxBufferSlots] = {};
+ UINT m_CommittedD3D11VBOffsets[MAX_BUFFER_SLOTS] = {};
/// Number committed vertex buffers
UINT m_NumCommittedD3D11VBs = 0;
/// Flag indicating if currently committed D3D11 vertex buffers are up to date
diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h
index 8a49d4a6..bbd9bc44 100644
--- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h
@@ -139,7 +139,7 @@ private:
Int8 m_ResourceLayoutIndex[6] = {-1, -1, -1, -1, -1, -1};
- Uint16 m_StaticSamplerOffsets[MaxShadersInPipeline + 1] = {};
+ Uint16 m_StaticSamplerOffsets[MAX_SHADERS_IN_PIPELINE + 1] = {};
struct StaticSamplerInfo
{
const D3DShaderResourceAttribs& Attribs;
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index d963c7b1..78f08bf4 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -701,7 +701,7 @@ void DeviceContextD3D11Impl::CommitD3D11IndexBuffer(VALUE_TYPE IndexType)
void DeviceContextD3D11Impl::CommitD3D11VertexBuffers(PipelineStateD3D11Impl* pPipelineStateD3D11)
{
- VERIFY(m_NumVertexStreams <= MaxBufferSlots, "Too many buffers are being set");
+ VERIFY(m_NumVertexStreams <= MAX_BUFFER_SLOTS, "Too many buffers are being set");
UINT NumBuffersToSet = std::max(m_NumVertexStreams, m_NumCommittedD3D11VBs);
bool BindVBs = m_NumVertexStreams != m_NumCommittedD3D11VBs;
@@ -1225,10 +1225,10 @@ void DeviceContextD3D11Impl::SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOf
void DeviceContextD3D11Impl::SetViewports(Uint32 NumViewports, const Viewport* pViewports, Uint32 RTWidth, Uint32 RTHeight)
{
- static_assert(MaxViewports >= D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE, "MaxViewports constant must be greater than D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE");
+ static_assert(MAX_VIEWPORTS >= D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE, "MaxViewports constant must be greater than D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE");
TDeviceContextBase::SetViewports(NumViewports, pViewports, RTWidth, RTHeight);
- D3D11_VIEWPORT d3d11Viewports[MaxViewports];
+ D3D11_VIEWPORT d3d11Viewports[MAX_VIEWPORTS];
VERIFY(NumViewports == m_NumViewports, "Unexpected number of viewports");
for (Uint32 vp = 0; vp < m_NumViewports; ++vp)
{
@@ -1246,10 +1246,10 @@ void DeviceContextD3D11Impl::SetViewports(Uint32 NumViewports, const Viewport* p
void DeviceContextD3D11Impl::SetScissorRects(Uint32 NumRects, const Rect* pRects, Uint32 RTWidth, Uint32 RTHeight)
{
- static_assert(MaxViewports >= D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE, "MaxViewports constant must be greater than D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE");
+ static_assert(MAX_VIEWPORTS >= D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE, "MaxViewports constant must be greater than D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE");
TDeviceContextBase::SetScissorRects(NumRects, pRects, RTWidth, RTHeight);
- D3D11_RECT d3d11ScissorRects[MaxViewports];
+ D3D11_RECT d3d11ScissorRects[MAX_VIEWPORTS];
VERIFY(NumRects == m_NumScissorRects, "Unexpected number of scissor rects");
for (Uint32 sr = 0; sr < NumRects; ++sr)
{
diff --git a/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp
index 0ba1e220..623dde46 100644
--- a/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp
@@ -43,7 +43,7 @@ namespace Diligent
{
/// Engine factory for D3D11 implementation
-class EngineFactoryD3D11Impl : public EngineFactoryD3DBase<IEngineFactoryD3D11, DeviceType::D3D11>
+class EngineFactoryD3D11Impl : public EngineFactoryD3DBase<IEngineFactoryD3D11, RENDER_DEVICE_TYPE_D3D11>
{
public:
static EngineFactoryD3D11Impl* GetInstance()
@@ -52,7 +52,7 @@ public:
return &TheFactory;
}
- using TBase = EngineFactoryD3DBase<IEngineFactoryD3D11, DeviceType::D3D11>;
+ using TBase = EngineFactoryD3DBase<IEngineFactoryD3D11, RENDER_DEVICE_TYPE_D3D11>;
EngineFactoryD3D11Impl() :
TBase{IID_EngineFactoryD3D11}
@@ -139,7 +139,7 @@ void EngineFactoryD3D11Impl::CreateDeviceAndContextsD3D11(const EngineD3D11Creat
#endif
CComPtr<IDXGIAdapter1> SpecificAdapter;
- if (EngineCI.AdapterId != EngineD3D11CreateInfo::DefaultAdapterId)
+ if (EngineCI.AdapterId != DEFAULT_ADAPTER_ID)
{
auto Adapters = FindCompatibleAdapters(EngineCI.MinimumFeatureLevel);
if (EngineCI.AdapterId < Adapters.size())
diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
index 8e2edfd9..7cc5313d 100644
--- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
@@ -133,7 +133,7 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCoun
#ifdef DEVELOPMENT
{
- const ShaderResources* pResources[MaxShadersInPipeline] = {};
+ const ShaderResources* pResources[MAX_SHADERS_IN_PIPELINE] = {};
for (Uint32 s = 0; s < m_NumShaders; ++s)
{
auto* pShader = GetShader<const ShaderD3D11Impl>(s);
@@ -143,9 +143,9 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCoun
}
#endif
- decltype(m_StaticSamplers) StaticSamplers(STD_ALLOCATOR_RAW_MEM(StaticSamplerInfo, GetRawAllocator(), "Allocator for vector<StaticSamplerInfo>"));
- std::array<size_t, MaxShadersInPipeline> ShaderResLayoutDataSizes = {};
- std::array<size_t, MaxShadersInPipeline> ShaderResCacheDataSizes = {};
+ decltype(m_StaticSamplers) StaticSamplers(STD_ALLOCATOR_RAW_MEM(StaticSamplerInfo, GetRawAllocator(), "Allocator for vector<StaticSamplerInfo>"));
+ std::array<size_t, MAX_SHADERS_IN_PIPELINE> ShaderResLayoutDataSizes = {};
+ std::array<size_t, MAX_SHADERS_IN_PIPELINE> ShaderResCacheDataSizes = {};
for (Uint32 s = 0; s < m_NumShaders; ++s)
{
auto* pShader = GetShader<const ShaderD3D11Impl>(s);
diff --git a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
index bd095fdf..b7e7a0bc 100644
--- a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
@@ -104,7 +104,7 @@ RenderDeviceD3D11Impl::RenderDeviceD3D11Impl(IReferenceCounters* pRefCo
m_pd3d11Device {pd3d11Device }
// clang-format on
{
- m_DeviceCaps.DevType = DeviceType::D3D11;
+ m_DeviceCaps.DevType = RENDER_DEVICE_TYPE_D3D11;
auto FeatureLevel = m_pd3d11Device->GetFeatureLevel();
switch (FeatureLevel)
{
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp
index bece12bb..8cf31521 100644
--- a/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp
@@ -34,7 +34,7 @@
namespace Diligent
{
-static const std::string HLSLVersionToShaderModelString(const ShaderCreateInfo::ShaderVersion& Version, Uint8 MaxMajorRevision, Uint8 MaxMinorRevision)
+static const std::string HLSLVersionToShaderModelString(const ShaderVersion& Version, Uint8 MaxMajorRevision, Uint8 MaxMinorRevision)
{
std::string ModelStr;
if (Version.Major > MaxMajorRevision || Version.Major == MaxMajorRevision && Version.Minor > MaxMinorRevision)
@@ -51,7 +51,7 @@ static const std::string HLSLVersionToShaderModelString(const ShaderCreateInfo::
return ModelStr;
}
-static const std::string GetD3D11ShaderModel(ID3D11Device* pd3d11Device, const ShaderCreateInfo::ShaderVersion& HLSLVersion)
+static const std::string GetD3D11ShaderModel(ID3D11Device* pd3d11Device, const ShaderVersion& HLSLVersion)
{
auto d3dDeviceFeatureLevel = pd3d11Device->GetFeatureLevel();
switch (d3dDeviceFeatureLevel)