1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0028826: Visualization, TKOpenGl - fix compatibility with strict OpenGL ES drivers

OpenGl_ShaderProgram::Initialize() - precision declarations have been moved
after the list of enabled extensions.

Declarations.glsl - the fragment shader outputs have been re-declared as array
for proper assignment of default locations (draw buffers).

OpenGl_FrameBuffer - GL_HALF_FLOAT is now used instead of GL_HALF_FLOAT_OES on OpenGL ES 3.2+.
OpenGl_Texture - fixed initialization of Image_Format_RGB32 image format on OpenGL ES 3.0+.
This commit is contained in:
kgv
2017-06-08 10:44:17 +03:00
committed by mkv
parent 8ae442a8cb
commit 177781da92
8 changed files with 85 additions and 25 deletions

View File

@@ -206,7 +206,7 @@ Standard_Boolean OpenGl_ShaderProgram::Initialize (const Handle(OpenGl_Context)&
}
TCollection_AsciiString aSource = aDeclarations + anIter.Value()->Source();
TCollection_AsciiString anExtensions = "// This section enables extensions used in OCCT GLSL programs\n";
TCollection_AsciiString anExtensions = "// Enable extensions used in OCCT GLSL programs\n";
if (theCtx->hasDrawBuffers)
{
anExtensions += "#define OCC_ENABLE_draw_buffers\n";
@@ -253,7 +253,7 @@ Standard_Boolean OpenGl_ShaderProgram::Initialize (const Handle(OpenGl_Context)&
"precision highp int;\n"
: "precision mediump float;\n"
"precision mediump int;\n");
aSource = aHeader + aPrefix + anExtensions + aSource;
aSource = aHeader + anExtensions + aPrefix + aSource;
#else
aSource = aHeader + anExtensions + aSource;
#endif