From 0c6bb538fb13d4416e4fef10e9615474f75981a5 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Mon, 22 Aug 2022 19:30:44 -0700 Subject: [PATCH] fix depth-only render pass invocation + throw instead of return --- src/Graphics/CommandBuffer.cs | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index 598d50b..07837ff 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -34,14 +34,12 @@ namespace MoonWorks.Graphics #if DEBUG if (colorAttachmentInfos.Length == 0) { - Logger.LogError("Render pass must contain at least one attachment!"); - return; + throw new System.ArgumentException("Render pass must contain at least one attachment!"); } if (colorAttachmentInfos.Length > 4) { - Logger.LogError("Render pass cannot have more than 4 color attachments!"); - return; + throw new System.ArgumentException("Render pass cannot have more than 4 color attachments!"); } #endif @@ -78,16 +76,9 @@ namespace MoonWorks.Graphics ) { #if DEBUG - if (colorAttachmentInfos.Length == 0) - { - Logger.LogError("Render pass must contain at least one attachment!"); - return; - } - if (colorAttachmentInfos.Length > 4) { - Logger.LogError("Render pass cannot have more than 4 color attachments!"); - return; + throw new System.ArgumentException("Render pass cannot have more than 4 color attachments!"); } #endif @@ -128,14 +119,12 @@ namespace MoonWorks.Graphics #if DEBUG if (colorAttachmentInfos.Length == 0) { - Logger.LogError("Render pass must contain at least one attachment!"); - return; + throw new System.ArgumentException("Render pass must contain at least one attachment!"); } if (colorAttachmentInfos.Length > 4) { - Logger.LogError("Render pass cannot have more than 4 color attachments!"); - return; + throw new System.ArgumentException("Render pass cannot have more than 4 color attachments!"); } #endif @@ -174,16 +163,9 @@ namespace MoonWorks.Graphics ) { #if DEBUG - if (colorAttachmentInfos.Length == 0) - { - Logger.LogError("Render pass must contain at least one attachment!"); - return; - } - if (colorAttachmentInfos.Length > 4) { - Logger.LogError("Render pass cannot have more than 4 color attachments!"); - return; + throw new System.ArgumentException("Render pass cannot have more than 4 color attachments!"); } #endif