16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 12:29:18 +02:00

merge manul

This commit is contained in:
WLs50
2025-03-09 15:36:11 +01:00
parent a687f551a2
commit a5f6397eca
1211 changed files with 483542 additions and 58643 deletions

View File

@@ -0,0 +1,37 @@
#include "copypass.h"
#include <nvrhi/utils.h>
#include "nvrendererbackend.h"
void CopyPass::Init() {
nvrhi::utils::CreateBindingSetAndLayout(
m_backend->GetDevice(), nvrhi::ShaderType::Pixel, 0,
nvrhi::BindingSetDesc()
.addItem(nvrhi::BindingSetItem::Texture_SRV(0, m_source))
.addItem(nvrhi::BindingSetItem::Sampler(
0, m_backend->GetDevice()->createSampler(nvrhi::SamplerDesc()))),
m_binding_layout, m_binding_set);
m_pixel_shader = m_backend->CreateShader("copy", nvrhi::ShaderType::Pixel);
m_framebuffer = m_backend->GetDevice()->createFramebuffer(
nvrhi::FramebufferDesc().addColorAttachment(m_output));
FullScreenPass::Init();
}
void CopyPass::CreatePipelineDesc(nvrhi::GraphicsPipelineDesc& pipeline_desc) {
FullScreenPass::CreatePipelineDesc(pipeline_desc);
pipeline_desc.addBindingLayout(m_binding_layout);
pipeline_desc.setPixelShader(m_pixel_shader);
}
void CopyPass::Render(nvrhi::ICommandList* command_list) {
nvrhi::GraphicsState graphics_state;
InitState(graphics_state);
graphics_state.addBindingSet(m_binding_set);
command_list->setGraphicsState(graphics_state);
Draw(command_list);
}
nvrhi::IFramebuffer* CopyPass::GetFramebuffer() {
return m_framebuffer;
}