diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-04-18 03:02:38 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-04-18 03:02:38 +0000 |
| commit | 3531a7d892a01cff3449d371df2784b75fa9a534 (patch) | |
| tree | e696e6c2ca892bd53112e65ab386e00c948deecb /Graphics/GraphicsEngineD3D11 | |
| parent | Added template version of RawPtr function to allow more convenient type conve... (diff) | |
| download | DiligentCore-3531a7d892a01cff3449d371df2784b75fa9a534.tar.gz DiligentCore-3531a7d892a01cff3449d371df2784b75fa9a534.zip | |
Working on Device context Vulkan implementation: implemented setting viewports & scissor rects
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
| -rw-r--r-- | Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index 6f43f0fa..f9b59ede 100644 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -865,10 +865,7 @@ namespace Diligent void DeviceContextD3D11Impl::SetViewports( Uint32 NumViewports, const Viewport *pViewports, Uint32 RTWidth, Uint32 RTHeight ) { - const Uint32 MaxViewports = D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; - VERIFY( NumViewports < MaxViewports, "Too many viewports are being set" ); - NumViewports = std::min( NumViewports, MaxViewports ); - + 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"); TDeviceContextBase::SetViewports( NumViewports, pViewports, RTWidth, RTHeight ); D3D11_VIEWPORT d3d11Viewports[MaxViewports]; @@ -889,13 +886,10 @@ namespace Diligent void DeviceContextD3D11Impl::SetScissorRects( Uint32 NumRects, const Rect *pRects, Uint32 RTWidth, Uint32 RTHeight ) { - const Uint32 MaxScissorRects = D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; - VERIFY( NumRects < MaxScissorRects, "Too many scissor rects are being set" ); - NumRects = std::min( NumRects, MaxScissorRects ); - + 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"); TDeviceContextBase::SetScissorRects(NumRects, pRects, RTWidth, RTHeight); - D3D11_RECT d3d11ScissorRects[MaxScissorRects]; + D3D11_RECT d3d11ScissorRects[MaxViewports]; VERIFY( NumRects == m_NumScissorRects, "Unexpected number of scissor rects" ); for( Uint32 sr = 0; sr < NumRects; ++sr ) { |
