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;
|
protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyComputePipeline;
|
||||||
|
|
||||||
|
public ShaderStageState ComputeShaderState { get; }
|
||||||
|
|
||||||
public unsafe ComputePipeline(
|
public unsafe ComputePipeline(
|
||||||
GraphicsDevice device,
|
GraphicsDevice device,
|
||||||
ShaderStageState computeShaderState,
|
ShaderStageState computeShaderState,
|
||||||
|
@ -34,6 +36,8 @@ namespace MoonWorks.Graphics
|
||||||
device.Handle,
|
device.Handle,
|
||||||
computePipelineCreateInfo
|
computePipelineCreateInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ComputeShaderState = computeShaderState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using RefreshCS;
|
using RefreshCS;
|
||||||
|
|
||||||
namespace MoonWorks.Graphics
|
namespace MoonWorks.Graphics
|
||||||
|
@ -7,6 +8,13 @@ namespace MoonWorks.Graphics
|
||||||
{
|
{
|
||||||
protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyFramebuffer;
|
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(
|
public unsafe Framebuffer(
|
||||||
GraphicsDevice device,
|
GraphicsDevice device,
|
||||||
uint width,
|
uint width,
|
||||||
|
@ -46,6 +54,16 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
Handle = Refresh.Refresh_CreateFramebuffer(device.Handle, framebufferCreateInfo);
|
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;
|
protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyGraphicsPipeline;
|
||||||
|
|
||||||
|
public ShaderStageState VertexShaderState { get; }
|
||||||
|
public ShaderStageState FragmentShaderState { get; }
|
||||||
|
public RenderPass RenderPass { get; }
|
||||||
|
|
||||||
public unsafe GraphicsPipeline(
|
public unsafe GraphicsPipeline(
|
||||||
GraphicsDevice device,
|
GraphicsDevice device,
|
||||||
ColorBlendState colorBlendState,
|
ColorBlendState colorBlendState,
|
||||||
|
@ -99,6 +103,10 @@ namespace MoonWorks.Graphics
|
||||||
vertexBindingsHandle.Free();
|
vertexBindingsHandle.Free();
|
||||||
viewportHandle.Free();
|
viewportHandle.Free();
|
||||||
scissorHandle.Free();
|
scissorHandle.Free();
|
||||||
|
|
||||||
|
VertexShaderState = vertexShaderState;
|
||||||
|
FragmentShaderState = fragmentShaderState;
|
||||||
|
RenderPass = renderPass;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue