Fix some issues found with WSLg

This commit is contained in:
Jérôme Leclercq
2021-10-29 14:38:56 +02:00
parent 32c204e95f
commit 078060cfc9
3 changed files with 12 additions and 3 deletions

View File

@@ -163,7 +163,7 @@ namespace Nz
else
{
vertexBuffer = m_device.InstantiateBuffer(BufferType::Vertex);
vertexBuffer->Initialize(m_maxVertexBufferSize, BufferUsage::DeviceLocal);
vertexBuffer->Initialize(m_maxVertexBufferSize, BufferUsage::DeviceLocal | BufferUsage::Dynamic);
}
currentVertexBuffer = vertexBuffer.get();

View File

@@ -214,8 +214,14 @@ namespace Nz
{
assert(command.framebuffer->GetType() == FramebufferType::Window);
GLenum buffer = GL_BACK;
context->glDrawBuffers(1, &buffer);
// glDrawBuffers doesn't accept GL_BACK on OpenGL non-ES, and glDrawBuffer must be used instead
if (context->glDrawBuffer)
context->glDrawBuffer(GL_BACK);
else
{
GLenum buffer = GL_BACK;
context->glDrawBuffers(1, &buffer);
}
invalidateAttachments = NazaraStackVector(GLenum, 3); //< color + depth + stencil