mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-07-20 12:45:50 +03:00
0026810: Visualization, TKOpenGl - line is shown without stipple aspect with FFP turned off on OpenGL before 3.2
OpenGl_ShaderManager::prepareStdProgramFlat() enable stipple line GLSL program within OpenGL 3.0+, OpenGL ES 3.0+ and OpenGL 2.0+ with GL_EXT_gpu_shader4 extension.
This commit is contained in:
parent
15478b1b87
commit
959a265a68
@ -1260,22 +1260,27 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramFlat (Handle(OpenGl_Shad
|
||||
TCollection_AsciiString aSrcVertEndMain;
|
||||
if ((theBits & OpenGl_PO_StippleLine) != 0)
|
||||
{
|
||||
bool hasCaps = false;
|
||||
bool hasGlslBitOps = false;
|
||||
#if defined(GL_ES_VERSION_2_0)
|
||||
if (myContext->IsGlGreaterEqual (3, 0))
|
||||
{
|
||||
aProgramSrc->SetHeader ("#version 300 es");
|
||||
hasCaps = true;
|
||||
hasGlslBitOps = true;
|
||||
}
|
||||
#else
|
||||
if (myContext->core32 != NULL)
|
||||
if (myContext->IsGlGreaterEqual (3, 0))
|
||||
{
|
||||
aProgramSrc->SetHeader ("#version 150");
|
||||
hasCaps = true;
|
||||
aProgramSrc->SetHeader ("#version 130");
|
||||
hasGlslBitOps = true;
|
||||
}
|
||||
else if(myContext->CheckExtension("GL_EXT_gpu_shader4"))
|
||||
{
|
||||
aProgramSrc->SetHeader ("#extension GL_EXT_gpu_shader4 : enable");
|
||||
hasGlslBitOps = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (hasCaps)
|
||||
if (hasGlslBitOps)
|
||||
{
|
||||
aSrcVertExtraOut +=
|
||||
EOL"THE_SHADER_OUT vec2 ScreenSpaceCoord;";
|
||||
|
Loading…
x
Reference in New Issue
Block a user