summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-04-18 03:02:38 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-04-18 03:02:38 +0000
commit3531a7d892a01cff3449d371df2784b75fa9a534 (patch)
treee696e6c2ca892bd53112e65ab386e00c948deecb /Graphics/GraphicsEngineD3D12
parentAdded template version of RawPtr function to allow more convenient type conve... (diff)
downloadDiligentCore-3531a7d892a01cff3449d371df2784b75fa9a534.tar.gz
DiligentCore-3531a7d892a01cff3449d371df2784b75fa9a534.zip
Working on Device context Vulkan implementation: implemented setting viewports & scissor rects
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index 9fbb8785..63444a17 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -564,7 +564,7 @@ namespace Diligent
void DeviceContextD3D12Impl::CommitViewports()
{
- constexpr Uint32 MaxViewports = D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE;
+ static_assert(MaxViewports >= D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE, "MaxViewports constant must be greater than D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE");
D3D12_VIEWPORT d3d12Viewports[MaxViewports]; // Do not waste time initializing array to zero
for( Uint32 vp = 0; vp < m_NumViewports; ++vp )
@@ -583,10 +583,7 @@ namespace Diligent
void DeviceContextD3D12Impl::SetViewports( Uint32 NumViewports, const Viewport *pViewports, Uint32 RTWidth, Uint32 RTHeight )
{
- constexpr Uint32 MaxViewports = D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE;
- VERIFY( NumViewports < MaxViewports, "Too many viewports are being set" );
- NumViewports = std::min( NumViewports, MaxViewports );
-
+ static_assert(MaxViewports >= D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE, "MaxViewports constant must be greater than D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE");
TDeviceContextBase::SetViewports( NumViewports, pViewports, RTWidth, RTHeight );
VERIFY( NumViewports == m_NumViewports, "Unexpected number of viewports" );