Keaton-Ryujinx/src/Ryujinx.Graphics.Vulkan/PipelineHelperShader.cs
KeatonTheBot 254a060c70
Some checks failed
Release job / Create tag (push) Has been cancelled
Release job / Release for linux-arm64 (push) Has been cancelled
Release job / Release for linux-x64 (push) Has been cancelled
Release job / Release for win-x64 (push) Has been cancelled
Release job / Release MacOS universal (push) Has been cancelled
Release job / flatpak_release (push) Has been cancelled
misc: chore: Remove unnecessary usings
2024-12-12 01:08:47 -06:00

53 lines
1.4 KiB
C#

using Silk.NET.Vulkan;
namespace Ryujinx.Graphics.Vulkan
{
class PipelineHelperShader : PipelineBase
{
public PipelineHelperShader(VulkanRenderer gd, Device device) : base(gd, device)
{
}
public void SetRenderTarget(TextureView view, uint width, uint height)
{
CreateFramebuffer(view, width, height);
CreateRenderPass();
SignalStateChange();
}
private void CreateFramebuffer(TextureView view, uint width, uint height)
{
FramebufferParams = new FramebufferParams(Device, view, width, height);
UpdatePipelineAttachmentFormats();
}
public void SetCommandBuffer(CommandBufferScoped cbs)
{
CommandBuffer = (Cbs = cbs).CommandBuffer;
// Restore per-command buffer state.
if (Pipeline != null)
{
Gd.Api.CmdBindPipeline(CommandBuffer, Pbp, Pipeline.Get(CurrentCommandBuffer).Value);
}
SignalCommandBufferChange();
}
public void Finish()
{
EndRenderPass();
}
public void Finish(VulkanRenderer gd, CommandBufferScoped cbs)
{
Finish();
if (gd.PipelineInternal.IsCommandBufferActive(cbs.CommandBuffer))
{
gd.PipelineInternal.Restore();
}
}
}
}