forked from MoonsideGames/MoonWorks
add explicit resource dependencies to graphics resource objects
parent
186b025b4d
commit
5524e501f3
|
@ -7,6 +7,8 @@ namespace MoonWorks.Graphics
|
|||
{
|
||||
protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyComputePipeline;
|
||||
|
||||
public ShaderStageState ComputeShaderState { get; }
|
||||
|
||||
public unsafe ComputePipeline(
|
||||
GraphicsDevice device,
|
||||
ShaderStageState computeShaderState,
|
||||
|
@ -34,6 +36,8 @@ namespace MoonWorks.Graphics
|
|||
device.Handle,
|
||||
computePipelineCreateInfo
|
||||
);
|
||||
|
||||
ComputeShaderState = computeShaderState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RefreshCS;
|
||||
|
||||
namespace MoonWorks.Graphics
|
||||
|
@ -7,6 +8,13 @@ namespace MoonWorks.Graphics
|
|||
{
|
||||
protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyFramebuffer;
|
||||
|
||||
public RenderTarget DepthStencilTarget { get; }
|
||||
|
||||
private RenderTarget[] colorTargets { get; }
|
||||
public IEnumerable<RenderTarget> ColorTargets => colorTargets;
|
||||
|
||||
public RenderPass RenderPass { get; }
|
||||
|
||||
public unsafe Framebuffer(
|
||||
GraphicsDevice device,
|
||||
uint width,
|
||||
|
@ -46,6 +54,16 @@ namespace MoonWorks.Graphics
|
|||
|
||||
Handle = Refresh.Refresh_CreateFramebuffer(device.Handle, framebufferCreateInfo);
|
||||
}
|
||||
|
||||
DepthStencilTarget = depthStencilTarget;
|
||||
|
||||
this.colorTargets = new RenderTarget[colorTargets.Length];
|
||||
for (var i = 0; i < colorTargets.Length; i++)
|
||||
{
|
||||
this.colorTargets[i] = colorTargets[i];
|
||||
}
|
||||
|
||||
RenderPass = renderPass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,10 @@ namespace MoonWorks.Graphics
|
|||
{
|
||||
protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyGraphicsPipeline;
|
||||
|
||||
public ShaderStageState VertexShaderState { get; }
|
||||
public ShaderStageState FragmentShaderState { get; }
|
||||
public RenderPass RenderPass { get; }
|
||||
|
||||
public unsafe GraphicsPipeline(
|
||||
GraphicsDevice device,
|
||||
ColorBlendState colorBlendState,
|
||||
|
@ -99,6 +103,10 @@ namespace MoonWorks.Graphics
|
|||
vertexBindingsHandle.Free();
|
||||
viewportHandle.Free();
|
||||
scissorHandle.Free();
|
||||
|
||||
VertexShaderState = vertexShaderState;
|
||||
FragmentShaderState = fragmentShaderState;
|
||||
RenderPass = renderPass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue