fix render pass validation

refresh2
cosmonaut 2024-06-05 22:39:42 -07:00
parent ad025e1777
commit 6d95203816
2 changed files with 0 additions and 17 deletions

View File

@ -609,7 +609,6 @@ public class CommandBuffer
AssertRenderPassActive(); AssertRenderPassActive();
renderPassActive = false; renderPassActive = false;
renderPass.active = false;
#endif #endif
Refresh.Refresh_EndRenderPass( Refresh.Refresh_EndRenderPass(

View File

@ -12,7 +12,6 @@ public class RenderPass
public nint Handle { get; private set; } public nint Handle { get; private set; }
#if DEBUG #if DEBUG
internal bool active;
internal uint colorAttachmentCount; internal uint colorAttachmentCount;
internal SampleCount colorAttachmentSampleCount; internal SampleCount colorAttachmentSampleCount;
internal TextureFormat colorFormatOne; internal TextureFormat colorFormatOne;
@ -39,7 +38,6 @@ public class RenderPass
GraphicsPipeline graphicsPipeline GraphicsPipeline graphicsPipeline
) { ) {
#if DEBUG #if DEBUG
AssertRenderPassActive();
AssertRenderPassPipelineFormatMatch(graphicsPipeline); AssertRenderPassPipelineFormatMatch(graphicsPipeline);
if (colorAttachmentCount > 0) if (colorAttachmentCount > 0)
@ -74,10 +72,6 @@ public class RenderPass
/// </summary> /// </summary>
public void SetViewport(in Viewport viewport) public void SetViewport(in Viewport viewport)
{ {
#if DEBUG
AssertRenderPassActive();
#endif
Refresh.Refresh_SetViewport( Refresh.Refresh_SetViewport(
Handle, Handle,
viewport.ToRefresh() viewport.ToRefresh()
@ -90,8 +84,6 @@ public class RenderPass
public void SetScissor(in Rect scissor) public void SetScissor(in Rect scissor)
{ {
#if DEBUG #if DEBUG
AssertRenderPassActive();
if (scissor.X < 0 || scissor.Y < 0 || scissor.W <= 0 || scissor.H <= 0) 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!"); throw new System.ArgumentOutOfRangeException("Scissor position cannot be negative and dimensions must be positive!");
@ -442,14 +434,6 @@ public class RenderPass
} }
#if DEBUG #if DEBUG
private void AssertRenderPassActive(string message = "Render pass is not active!")
{
if (!active)
{
throw new System.InvalidOperationException(message);
}
}
private void AssertRenderPassPipelineFormatMatch(GraphicsPipeline graphicsPipeline) private void AssertRenderPassPipelineFormatMatch(GraphicsPipeline graphicsPipeline)
{ {
for (var i = 0; i < graphicsPipeline.AttachmentInfo.ColorAttachmentDescriptions.Length; i += 1) for (var i = 0; i < graphicsPipeline.AttachmentInfo.ColorAttachmentDescriptions.Length; i += 1)