From: kgv Date: Sat, 24 Oct 2015 14:32:36 +0000 (+0300) Subject: 0026810: Visualization, TKOpenGl - line is shown without stipple aspect with FFP... X-Git-Tag: V7_0_0_beta~158 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=959a265a68e99a3af2a557629281368f644706e6;p=occt.git 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. --- diff --git a/src/OpenGl/OpenGl_ShaderManager.cxx b/src/OpenGl/OpenGl_ShaderManager.cxx index 75b7d28a60..0e48750fe3 100644 --- a/src/OpenGl/OpenGl_ShaderManager.cxx +++ b/src/OpenGl/OpenGl_ShaderManager.cxx @@ -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 130"); + hasGlslBitOps = true; + } + else if(myContext->CheckExtension("GL_EXT_gpu_shader4")) { - aProgramSrc->SetHeader ("#version 150"); - hasCaps = true; + aProgramSrc->SetHeader ("#extension GL_EXT_gpu_shader4 : enable"); + hasGlslBitOps = true; } #endif - if (hasCaps) + if (hasGlslBitOps) { aSrcVertExtraOut += EOL"THE_SHADER_OUT vec2 ScreenSpaceCoord;";