Make the provoking vertex consistent across OpenGL, D3D and Vulkan (#2360)
The default provoking vertex on OpenGL is the last of a triangle, but on D3D and Vulkan it is the first. This patch sets the provoking vertex to the first vertex on OpenGL.
This commit is contained in:
parent
26c3768cac
commit
758566b3af
@ -170,6 +170,7 @@ typedef void (GL_APIENTRYP PFNGLPOLYGONMODEPROC) (GLenum face, GLenum
|
||||
typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
|
||||
typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
|
||||
typedef void (GL_APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
|
||||
typedef void (GL_APIENTRYP PFNGLREADBUFFERPROC) (GLenum mode);
|
||||
@ -371,6 +372,7 @@ GL_IMPORT______(false, PFNGLPIXELSTOREIPROC, glPixelStorei
|
||||
GL_IMPORT______(true, PFNGLPOPDEBUGGROUPPROC, glPopDebugGroup);
|
||||
GL_IMPORT______(true, PFNGLPROGRAMBINARYPROC, glProgramBinary);
|
||||
GL_IMPORT______(true, PFNGLPROGRAMPARAMETERIPROC, glProgramParameteri);
|
||||
GL_IMPORT______(true, PFNGLPROVOKINGVERTEXPROC, glProvokingVertex);
|
||||
GL_IMPORT______(true, PFNGLPUSHDEBUGGROUPPROC, glPushDebugGroup);
|
||||
GL_IMPORT______(true, PFNGLQUERYCOUNTERPROC, glQueryCounter);
|
||||
GL_IMPORT______(true, PFNGLREADBUFFERPROC, glReadBuffer);
|
||||
|
@ -525,6 +525,7 @@ namespace bgfx { namespace gl
|
||||
ARB_occlusion_query,
|
||||
ARB_occlusion_query2,
|
||||
ARB_program_interface_query,
|
||||
ARB_provoking_vertex,
|
||||
ARB_sampler_objects,
|
||||
ARB_seamless_cube_map,
|
||||
ARB_shader_bit_encoding,
|
||||
@ -738,6 +739,7 @@ namespace bgfx { namespace gl
|
||||
{ "ARB_occlusion_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_occlusion_query2", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_program_interface_query", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
||||
{ "ARB_provoking_vertex", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
||||
{ "ARB_sampler_objects", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
{ "ARB_seamless_cube_map", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
||||
{ "ARB_shader_bit_encoding", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
||||
@ -3003,6 +3005,11 @@ namespace bgfx { namespace gl
|
||||
GL_CHECK(glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS) );
|
||||
}
|
||||
|
||||
if (s_extension[Extension::ARB_provoking_vertex].m_supported)
|
||||
{
|
||||
GL_CHECK(glProvokingVertex(GL_FIRST_VERTEX_CONVENTION) );
|
||||
}
|
||||
|
||||
if (NULL == glInsertEventMarker
|
||||
|| !s_extension[Extension::EXT_debug_marker].m_supported)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user