mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
VideoBackends: add support to allow rendering to multiple output textures
This commit is contained in:
@ -44,11 +44,13 @@ std::unique_ptr<AbstractStagingTexture> SWGfx::CreateStagingTexture(StagingTextu
|
||||
return std::make_unique<SWStagingTexture>(type, config);
|
||||
}
|
||||
|
||||
std::unique_ptr<AbstractFramebuffer> SWGfx::CreateFramebuffer(AbstractTexture* color_attachment,
|
||||
AbstractTexture* depth_attachment)
|
||||
std::unique_ptr<AbstractFramebuffer>
|
||||
SWGfx::CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment,
|
||||
std::vector<AbstractTexture*> additional_color_attachments)
|
||||
{
|
||||
return SWFramebuffer::Create(static_cast<SWTexture*>(color_attachment),
|
||||
static_cast<SWTexture*>(depth_attachment));
|
||||
static_cast<SWTexture*>(depth_attachment),
|
||||
std::move(additional_color_attachments));
|
||||
}
|
||||
|
||||
void SWGfx::BindBackbuffer(const ClearColor& clear_color)
|
||||
|
@ -22,7 +22,8 @@ public:
|
||||
std::unique_ptr<AbstractStagingTexture>
|
||||
CreateStagingTexture(StagingTextureType type, const TextureConfig& config) override;
|
||||
std::unique_ptr<AbstractFramebuffer>
|
||||
CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment) override;
|
||||
CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment,
|
||||
std::vector<AbstractTexture*> additional_color_attachments) override;
|
||||
|
||||
void BindBackbuffer(const ClearColor& clear_color = {}) override;
|
||||
|
||||
|
@ -159,17 +159,20 @@ void SWStagingTexture::Flush()
|
||||
}
|
||||
|
||||
SWFramebuffer::SWFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment,
|
||||
std::vector<AbstractTexture*> additional_color_attachments,
|
||||
AbstractTextureFormat color_format, AbstractTextureFormat depth_format,
|
||||
u32 width, u32 height, u32 layers, u32 samples)
|
||||
: AbstractFramebuffer(color_attachment, depth_attachment, color_format, depth_format, width,
|
||||
height, layers, samples)
|
||||
: AbstractFramebuffer(color_attachment, depth_attachment,
|
||||
std::move(additional_color_attachments), color_format, depth_format,
|
||||
width, height, layers, samples)
|
||||
{
|
||||
}
|
||||
|
||||
std::unique_ptr<SWFramebuffer> SWFramebuffer::Create(SWTexture* color_attachment,
|
||||
SWTexture* depth_attachment)
|
||||
std::unique_ptr<SWFramebuffer>
|
||||
SWFramebuffer::Create(SWTexture* color_attachment, SWTexture* depth_attachment,
|
||||
std::vector<AbstractTexture*> additional_color_attachments)
|
||||
{
|
||||
if (!ValidateConfig(color_attachment, depth_attachment))
|
||||
if (!ValidateConfig(color_attachment, depth_attachment, additional_color_attachments))
|
||||
return nullptr;
|
||||
|
||||
const AbstractTextureFormat color_format =
|
||||
@ -182,7 +185,8 @@ std::unique_ptr<SWFramebuffer> SWFramebuffer::Create(SWTexture* color_attachment
|
||||
const u32 layers = either_attachment->GetLayers();
|
||||
const u32 samples = either_attachment->GetSamples();
|
||||
|
||||
return std::make_unique<SWFramebuffer>(color_attachment, depth_attachment, color_format,
|
||||
return std::make_unique<SWFramebuffer>(color_attachment, depth_attachment,
|
||||
std::move(additional_color_attachments), color_format,
|
||||
depth_format, width, height, layers, samples);
|
||||
}
|
||||
|
||||
|
@ -63,12 +63,14 @@ class SWFramebuffer final : public AbstractFramebuffer
|
||||
{
|
||||
public:
|
||||
explicit SWFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment,
|
||||
std::vector<AbstractTexture*> additional_color_attachments,
|
||||
AbstractTextureFormat color_format, AbstractTextureFormat depth_format,
|
||||
u32 width, u32 height, u32 layers, u32 samples);
|
||||
~SWFramebuffer() override = default;
|
||||
|
||||
static std::unique_ptr<SWFramebuffer> Create(SWTexture* color_attachment,
|
||||
SWTexture* depth_attachment);
|
||||
static std::unique_ptr<SWFramebuffer>
|
||||
Create(SWTexture* color_attachment, SWTexture* depth_attachment,
|
||||
std::vector<AbstractTexture*> additional_color_attachments);
|
||||
};
|
||||
|
||||
} // namespace SW
|
||||
|
Reference in New Issue
Block a user