From 6d9520381654fa5b3b2adefe7983fda6c829a87b Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 5 Jun 2024 22:39:42 -0700 Subject: [PATCH] fix render pass validation --- src/Graphics/CommandBuffer.cs | 1 - src/Graphics/RenderPass.cs | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index a4d22e6..aec7f33 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -609,7 +609,6 @@ public class CommandBuffer AssertRenderPassActive(); renderPassActive = false; - renderPass.active = false; #endif Refresh.Refresh_EndRenderPass( diff --git a/src/Graphics/RenderPass.cs b/src/Graphics/RenderPass.cs index 26475aa..62265a0 100644 --- a/src/Graphics/RenderPass.cs +++ b/src/Graphics/RenderPass.cs @@ -12,7 +12,6 @@ public class RenderPass public nint Handle { get; private set; } #if DEBUG - internal bool active; internal uint colorAttachmentCount; internal SampleCount colorAttachmentSampleCount; internal TextureFormat colorFormatOne; @@ -39,7 +38,6 @@ public class RenderPass GraphicsPipeline graphicsPipeline ) { #if DEBUG - AssertRenderPassActive(); AssertRenderPassPipelineFormatMatch(graphicsPipeline); if (colorAttachmentCount > 0) @@ -74,10 +72,6 @@ public class RenderPass /// public void SetViewport(in Viewport viewport) { -#if DEBUG - AssertRenderPassActive(); -#endif - Refresh.Refresh_SetViewport( Handle, viewport.ToRefresh() @@ -90,8 +84,6 @@ public class RenderPass public void SetScissor(in Rect scissor) { #if DEBUG - AssertRenderPassActive(); - if (scissor.X < 0 || scissor.Y < 0 || scissor.W <= 0 || scissor.H <= 0) { throw new System.ArgumentOutOfRangeException("Scissor position cannot be negative and dimensions must be positive!"); @@ -442,14 +434,6 @@ public class RenderPass } #if DEBUG - private void AssertRenderPassActive(string message = "Render pass is not active!") - { - if (!active) - { - throw new System.InvalidOperationException(message); - } - } - private void AssertRenderPassPipelineFormatMatch(GraphicsPipeline graphicsPipeline) { for (var i = 0; i < graphicsPipeline.AttachmentInfo.ColorAttachmentDescriptions.Length; i += 1)