Skip to content

Commit

Permalink
GL: allow geometry shaders via GL3.2 instead of EXT_geometry_shader4
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Mar 26, 2022
1 parent 364456b commit f154a54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
20 changes: 10 additions & 10 deletions RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,19 +423,19 @@ namespace Ogre {
// attach Geometry Program
mShaders[GPT_GEOMETRY_PROGRAM]->attachToProgramObject(mGLProgramHandle);

//Don't set adjacency flag. We handle it internally and expose "false"

RenderOperation::OperationType inputOperationType = gshader->getInputOperationType();
glProgramParameteriEXT(mGLProgramHandle, GL_GEOMETRY_INPUT_TYPE_EXT,
getGLGeometryInputPrimitiveType(inputOperationType));
if (GLAD_GL_EXT_geometry_shader4)
{
RenderOperation::OperationType inputOperationType = gshader->getInputOperationType();
glProgramParameteriEXT(mGLProgramHandle, GL_GEOMETRY_INPUT_TYPE_EXT,
getGLGeometryInputPrimitiveType(inputOperationType));

RenderOperation::OperationType outputOperationType = gshader->getOutputOperationType();
RenderOperation::OperationType outputOperationType = gshader->getOutputOperationType();

glProgramParameteriEXT(mGLProgramHandle, GL_GEOMETRY_OUTPUT_TYPE_EXT,
getGLGeometryOutputPrimitiveType(outputOperationType));
glProgramParameteriEXT(mGLProgramHandle, GL_GEOMETRY_OUTPUT_TYPE_EXT,
getGLGeometryOutputPrimitiveType(outputOperationType));

glProgramParameteriEXT(mGLProgramHandle, GL_GEOMETRY_VERTICES_OUT_EXT,
gshader->getMaxOutputVertices());
glProgramParameteriEXT(mGLProgramHandle, GL_GEOMETRY_VERTICES_OUT_EXT, gshader->getMaxOutputVertices());
}
}

if (mShaders[GPT_FRAGMENT_PROGRAM])
Expand Down
3 changes: 1 addition & 2 deletions RenderSystems/GL/src/OgreGLRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,7 @@ namespace Ogre {
}

// Check if geometry shaders are supported
if (GLAD_GL_VERSION_2_0 &&
GLAD_GL_EXT_geometry_shader4)
if (hasMinGLVersion(3, 2) || (GLAD_GL_VERSION_2_0 && GLAD_GL_EXT_geometry_shader4))
{
rsc->setCapability(RSC_GEOMETRY_PROGRAM);
GLint floatConstantCount = 0;
Expand Down

0 comments on commit f154a54

Please sign in to comment.