Skip to content

Commit 8fb2842

Browse files
D3D12: added assert that format plane count is greater than 0
1 parent 6f1337d commit 8fb2842

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,9 @@ void DeviceContextD3D12Impl::CopyTexture(const CopyTextureAttribs& CopyAttribs)
19621962
std::array<SubresCopyMapping, MaxFormatPlaneCount> Planes;
19631963

19641964
Uint32 NumPlanes = std::min(pSrcTexD3D12->GetFormatPlaneCount(), pDstTexD3D12->GetFormatPlaneCount());
1965-
VERIFY(NumPlanes <= MaxFormatPlaneCount, "Number of planes (", NumPlanes, ") exceeds maximum supported plane count (", MaxFormatPlaneCount, ")");
1965+
VERIFY(NumPlanes > 0, "Number of planes must be greater than 0");
1966+
NumPlanes = std::max(NumPlanes, 1u);
1967+
VERIFY(NumPlanes <= MaxFormatPlaneCount, "Number of planes (", NumPlanes, ") exceeds maximum expected plane count (", MaxFormatPlaneCount, ")");
19661968
NumPlanes = std::min(NumPlanes, MaxFormatPlaneCount);
19671969
for (Uint32 i = 0; i < NumPlanes; ++i)
19681970
{

0 commit comments

Comments
 (0)