Fix some issues found with WSLg
This commit is contained in:
parent
32c204e95f
commit
078060cfc9
|
|
@ -21,6 +21,7 @@
|
||||||
#define GL_SPIR_V_BINARY_ARB 0x9552
|
#define GL_SPIR_V_BINARY_ARB 0x9552
|
||||||
typedef void (GL_APIENTRYP PFNGLPOLYGONMODEPROC) (GLenum face, GLenum mode);
|
typedef void (GL_APIENTRYP PFNGLPOLYGONMODEPROC) (GLenum face, GLenum mode);
|
||||||
typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar* pEntryPoint, GLuint numSpecializationConstants, const GLuint* pConstantIndex, const GLuint* pConstantValue);
|
typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar* pEntryPoint, GLuint numSpecializationConstants, const GLuint* pConstantIndex, const GLuint* pConstantValue);
|
||||||
|
typedef void (GL_APIENTRYP PFNGLDRAWBUFFERPROC) (GLenum buf);
|
||||||
|
|
||||||
// OpenGL core
|
// OpenGL core
|
||||||
#define NAZARA_OPENGLRENDERER_FOREACH_GLES_FUNC(cb, extCb) \
|
#define NAZARA_OPENGLRENDERER_FOREACH_GLES_FUNC(cb, extCb) \
|
||||||
|
|
@ -173,6 +174,8 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const G
|
||||||
\
|
\
|
||||||
extCb(glDebugMessageCallback, PFNGLDEBUGMESSAGECALLBACKPROC) \
|
extCb(glDebugMessageCallback, PFNGLDEBUGMESSAGECALLBACKPROC) \
|
||||||
\
|
\
|
||||||
|
extCb(glDrawBuffer, PFNGLDRAWBUFFERPROC) \
|
||||||
|
\
|
||||||
extCb(glPolygonMode, PFNGLPOLYGONMODEPROC) \
|
extCb(glPolygonMode, PFNGLPOLYGONMODEPROC) \
|
||||||
\
|
\
|
||||||
extCb(glMemoryBarrier, PFNGLMEMORYBARRIERPROC) \
|
extCb(glMemoryBarrier, PFNGLMEMORYBARRIERPROC) \
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ namespace Nz
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
vertexBuffer = m_device.InstantiateBuffer(BufferType::Vertex);
|
vertexBuffer = m_device.InstantiateBuffer(BufferType::Vertex);
|
||||||
vertexBuffer->Initialize(m_maxVertexBufferSize, BufferUsage::DeviceLocal);
|
vertexBuffer->Initialize(m_maxVertexBufferSize, BufferUsage::DeviceLocal | BufferUsage::Dynamic);
|
||||||
}
|
}
|
||||||
|
|
||||||
currentVertexBuffer = vertexBuffer.get();
|
currentVertexBuffer = vertexBuffer.get();
|
||||||
|
|
|
||||||
|
|
@ -214,8 +214,14 @@ namespace Nz
|
||||||
{
|
{
|
||||||
assert(command.framebuffer->GetType() == FramebufferType::Window);
|
assert(command.framebuffer->GetType() == FramebufferType::Window);
|
||||||
|
|
||||||
GLenum buffer = GL_BACK;
|
// glDrawBuffers doesn't accept GL_BACK on OpenGL non-ES, and glDrawBuffer must be used instead
|
||||||
context->glDrawBuffers(1, &buffer);
|
if (context->glDrawBuffer)
|
||||||
|
context->glDrawBuffer(GL_BACK);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GLenum buffer = GL_BACK;
|
||||||
|
context->glDrawBuffers(1, &buffer);
|
||||||
|
}
|
||||||
|
|
||||||
invalidateAttachments = NazaraStackVector(GLenum, 3); //< color + depth + stencil
|
invalidateAttachments = NazaraStackVector(GLenum, 3); //< color + depth + stencil
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue