Merge pull request #11859 from iwubcode/backend-multi-output

VideoBackends: add support to allow rendering to multiple output targets
This commit is contained in:
Admiral H. Curtiss
2023-06-09 13:40:21 +02:00
committed by GitHub
44 changed files with 714 additions and 328 deletions

View File

@ -28,7 +28,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;
std::unique_ptr<AbstractShader> CreateShaderFromSource(ShaderStage stage, std::string_view source,
std::string_view name) override;

View File

@ -93,7 +93,8 @@ Metal::Gfx::CreateStagingTexture(StagingTextureType type, const TextureConfig& c
}
std::unique_ptr<AbstractFramebuffer>
Metal::Gfx::CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment)
Metal::Gfx::CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment,
std::vector<AbstractTexture*>)
{
AbstractTexture* const either_attachment = color_attachment ? color_attachment : depth_attachment;
return std::make_unique<Framebuffer>(

View File

@ -191,7 +191,7 @@ void Metal::StagingTexture::Flush()
Metal::Framebuffer::Framebuffer(AbstractTexture* color, AbstractTexture* depth, //
u32 width, u32 height, u32 layers, u32 samples)
: AbstractFramebuffer(color, depth,
: AbstractFramebuffer(color, depth, {},
color ? color->GetFormat() : AbstractTextureFormat::Undefined, //
depth ? depth->GetFormat() : AbstractTextureFormat::Undefined, //
width, height, layers, samples)