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();

View File

@@ -35,14 +35,14 @@ namespace Nz
return RenderFrame(m_renderImage[m_currentFrame].get(), invalidateFramebuffer, m_size, 0);
}
bool OpenGLRenderWindow::Create(RendererImpl* renderer, RenderSurface* surface, const RenderWindowParameters& parameters)
bool OpenGLRenderWindow::Create(RendererImpl* /*renderer*/, RenderSurface* surface, const RenderWindowParameters& parameters)
{
DummySurface* dummySurface = static_cast<DummySurface*>(surface);
OpenGLRenderer* glRenderer = static_cast<OpenGLRenderer*>(renderer);
OpenGLDevice& device = static_cast<OpenGLDevice&>(*m_owner.GetRenderDevice());
GL::ContextParams contextParams;
//TODO: Pass render window parameters to context
m_context = device.CreateContext(contextParams, dummySurface->GetWindowHandle());
if (!m_context)

View File

@@ -53,7 +53,7 @@ namespace Nz
return m_device;
}
bool OpenGLRenderer::Prepare(const ParameterList& parameters)
bool OpenGLRenderer::Prepare(const ParameterList& /*parameters*/)
{
std::unique_ptr<GL::Loader> loader = SelectLoader();
if (!loader)