Renderer: Fix MRT support

This commit is contained in:
Jérôme Leclercq
2021-05-05 12:01:20 +02:00
parent 990193ebb4
commit 10aa7231b6
8 changed files with 74 additions and 10 deletions

View File

@@ -149,6 +149,7 @@ namespace Nz
DrawStates m_currentStates;
std::size_t m_bindingIndex;
std::size_t m_maxColorBufferCount;
std::size_t m_poolIndex;
std::vector<CommandData> m_commands;
OpenGLCommandPool* m_owner;

View File

@@ -11,12 +11,14 @@
namespace Nz
{
inline OpenGLCommandBuffer::OpenGLCommandBuffer() :
m_maxColorBufferCount(0),
m_owner(nullptr)
{
}
inline OpenGLCommandBuffer::OpenGLCommandBuffer(OpenGLCommandPool& owner, std::size_t poolIndex, std::size_t bindingIndex) :
m_bindingIndex(bindingIndex),
m_maxColorBufferCount(0),
m_poolIndex(poolIndex),
m_owner(&owner)
{
@@ -135,6 +137,8 @@ namespace Nz
inline void OpenGLCommandBuffer::SetFramebuffer(const OpenGLFramebuffer& framebuffer, const RenderPass& /*renderPass*/, const CommandBufferBuilder::ClearValues* clearValues, std::size_t clearValueCount)
{
m_maxColorBufferCount = std::max(m_maxColorBufferCount, framebuffer.GetColorBufferCount());
SetFrameBufferData setFramebuffer;
setFramebuffer.framebuffer = &framebuffer;