Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit a3fb181

Browse files
committed
Fix for null reference exception in DeviceContext.RasterizerStage
1 parent e2f613c commit a3fb181

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Source/SharpDX.Direct3D11/DeviceContext.RasterizerStage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void SetScissorRectangles<T>(params T[] scissorRectangles) where T : stru
140140

141141
unsafe
142142
{
143-
void* pBuffer = Interop.Fixed(scissorRectangles);
143+
void* pBuffer = scissorRectangles == null ? (void*) null : Interop.Fixed(scissorRectangles);
144144
SetScissorRects(scissorRectangles == null ? 0 : scissorRectangles.Length, (IntPtr)pBuffer);
145145
}
146146
}
@@ -198,7 +198,7 @@ public void SetViewport(RawViewportF viewport)
198198
/// <remarks><p></p><p>All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.</p><p>Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.</p></remarks>
199199
public unsafe void SetViewports(RawViewportF[] viewports, int count = 0)
200200
{
201-
void* pBuffer = Interop.Fixed(viewports);
201+
void* pBuffer = viewports == null ? (void*) null : Interop.Fixed(viewports);
202202
SetViewports(viewports == null ? 0 : count <= 0 ? viewports.Length : count, (IntPtr)pBuffer);
203203
}
204204

0 commit comments

Comments
 (0)