diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index 03e001c..a296145 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -461,6 +461,17 @@ namespace MoonWorks.Graphics for (var i = 0; i < length; i += 1) { + #if DEBUG + if (textureSamplerBindings[i].Texture == null) + { + throw new NullReferenceException("Texture binding must not be null!"); + } + if (textureSamplerBindings[i].Texture == null) + { + throw new NullReferenceException("Sampler binding must not be null!"); + } + #endif + texturePtrs[i] = textureSamplerBindings[i].Texture.Handle; samplerPtrs[i] = textureSamplerBindings[i].Sampler.Handle; }