add validation checks for AcquireSwapchainTexture and BindVertexBuffers
parent
ca9fb45536
commit
5ccebc018f
|
@ -841,6 +841,10 @@ namespace MoonWorks.Graphics
|
||||||
in BufferBinding bufferBinding,
|
in BufferBinding bufferBinding,
|
||||||
uint firstBinding = 0
|
uint firstBinding = 0
|
||||||
) {
|
) {
|
||||||
|
#if DEBUG
|
||||||
|
AssertGraphicsPipelineBound();
|
||||||
|
#endif
|
||||||
|
|
||||||
var bufferPtrs = stackalloc IntPtr[1];
|
var bufferPtrs = stackalloc IntPtr[1];
|
||||||
var offsets = stackalloc ulong[1];
|
var offsets = stackalloc ulong[1];
|
||||||
|
|
||||||
|
@ -868,6 +872,10 @@ namespace MoonWorks.Graphics
|
||||||
in BufferBinding bufferBindingTwo,
|
in BufferBinding bufferBindingTwo,
|
||||||
uint firstBinding = 0
|
uint firstBinding = 0
|
||||||
) {
|
) {
|
||||||
|
#if DEBUG
|
||||||
|
AssertGraphicsPipelineBound();
|
||||||
|
#endif
|
||||||
|
|
||||||
var bufferPtrs = stackalloc IntPtr[2];
|
var bufferPtrs = stackalloc IntPtr[2];
|
||||||
var offsets = stackalloc ulong[2];
|
var offsets = stackalloc ulong[2];
|
||||||
|
|
||||||
|
@ -900,6 +908,10 @@ namespace MoonWorks.Graphics
|
||||||
in BufferBinding bufferBindingThree,
|
in BufferBinding bufferBindingThree,
|
||||||
uint firstBinding = 0
|
uint firstBinding = 0
|
||||||
) {
|
) {
|
||||||
|
#if DEBUG
|
||||||
|
AssertGraphicsPipelineBound();
|
||||||
|
#endif
|
||||||
|
|
||||||
var bufferPtrs = stackalloc IntPtr[3];
|
var bufferPtrs = stackalloc IntPtr[3];
|
||||||
var offsets = stackalloc ulong[3];
|
var offsets = stackalloc ulong[3];
|
||||||
|
|
||||||
|
@ -936,6 +948,10 @@ namespace MoonWorks.Graphics
|
||||||
in BufferBinding bufferBindingFour,
|
in BufferBinding bufferBindingFour,
|
||||||
uint firstBinding = 0
|
uint firstBinding = 0
|
||||||
) {
|
) {
|
||||||
|
#if DEBUG
|
||||||
|
AssertGraphicsPipelineBound();
|
||||||
|
#endif
|
||||||
|
|
||||||
var bufferPtrs = stackalloc IntPtr[4];
|
var bufferPtrs = stackalloc IntPtr[4];
|
||||||
var offsets = stackalloc ulong[4];
|
var offsets = stackalloc ulong[4];
|
||||||
|
|
||||||
|
@ -968,6 +984,10 @@ namespace MoonWorks.Graphics
|
||||||
in Span<BufferBinding> bufferBindings,
|
in Span<BufferBinding> bufferBindings,
|
||||||
uint firstBinding = 0
|
uint firstBinding = 0
|
||||||
) {
|
) {
|
||||||
|
#if DEBUG
|
||||||
|
AssertGraphicsPipelineBound();
|
||||||
|
#endif
|
||||||
|
|
||||||
var bufferPtrs = stackalloc IntPtr[bufferBindings.Length];
|
var bufferPtrs = stackalloc IntPtr[bufferBindings.Length];
|
||||||
var offsets = stackalloc ulong[bufferBindings.Length];
|
var offsets = stackalloc ulong[bufferBindings.Length];
|
||||||
|
|
||||||
|
@ -1617,6 +1637,12 @@ namespace MoonWorks.Graphics
|
||||||
Window window
|
Window window
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
|
if (!window.Claimed)
|
||||||
|
{
|
||||||
|
throw new System.InvalidOperationException("Cannot acquire swapchain texture, window has not been claimed!");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
var texturePtr = Refresh.Refresh_AcquireSwapchainTexture(
|
var texturePtr = Refresh.Refresh_AcquireSwapchainTexture(
|
||||||
Device.Handle,
|
Device.Handle,
|
||||||
Handle,
|
Handle,
|
||||||
|
|
Loading…
Reference in New Issue