Fix compilation errors and warnings

This commit is contained in:
Jérôme Leclercq
2021-07-07 22:16:22 +02:00
parent 1f6937ab1b
commit 309fd547e1
14 changed files with 38 additions and 30 deletions

View File

@@ -126,6 +126,9 @@ namespace Nz
const auto& attachmentInfo = command.renderpass->GetAttachment(i);
switch (PixelFormatInfo::GetContent(attachmentInfo.format))
{
case PixelFormatContent::Undefined:
break;
case PixelFormatContent::ColorRGBA:
colorIndexes[colorIndex++] = i;
break;
@@ -139,6 +142,12 @@ namespace Nz
if (!depthStencilIndex)
depthStencilIndex = i;
break;
case PixelFormatContent::Stencil:
//FIXME: I'm not sure stencil is properly handled here
if (!depthStencilIndex)
depthStencilIndex = i;
break;
}
}
@@ -164,7 +173,7 @@ namespace Nz
context->glClearBufferfv(GL_COLOR, GLint(i), clearColor.data());
}
else if (attachmentInfo.loadOp == AttachmentLoadOp::Discard)
invalidateAttachments.push_back(GL_COLOR_ATTACHMENT0 + i);
invalidateAttachments.push_back(static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + i));
}
if (depthStencilIndex)
@@ -210,7 +219,6 @@ namespace Nz
if (colorIndex > 0)
{
std::size_t colorBufferCount = command.framebuffer->GetColorBufferCount();
assert(colorBufferCount <= 1);
std::size_t colorAttachmentIndex = colorIndexes.front();