mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +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:
@@ -1699,16 +1699,16 @@ Standard_Boolean OpenGl_View::checkOitCompatibility (const Handle(OpenGl_Context
|
||||
}
|
||||
|
||||
TCollection_ExtendedString aCompatibilityMsg;
|
||||
if (!theGlContext->hasFloatBuffer
|
||||
&& !theGlContext->hasHalfFloatBuffer)
|
||||
if (theGlContext->hasFloatBuffer == OpenGl_FeatureNotAvailable
|
||||
&& theGlContext->hasHalfFloatBuffer == OpenGl_FeatureNotAvailable)
|
||||
{
|
||||
aCompatibilityMsg += "OpenGL context does not support floating-point RGBA color buffer format.\n";
|
||||
}
|
||||
if (theMSAA && !theGlContext->hasSampleVariables)
|
||||
if (theMSAA && theGlContext->hasSampleVariables == OpenGl_FeatureNotAvailable)
|
||||
{
|
||||
aCompatibilityMsg += "Current version of GLSL does not support built-in sample variables.\n";
|
||||
}
|
||||
if (!theGlContext->hasDrawBuffers)
|
||||
if (theGlContext->hasDrawBuffers == OpenGl_FeatureNotAvailable)
|
||||
{
|
||||
aCompatibilityMsg += "OpenGL context does not support multiple draw buffers.\n";
|
||||
}
|
||||
@@ -1741,14 +1741,14 @@ bool OpenGl_View::chooseOitColorConfiguration (const Handle(OpenGl_Context)& the
|
||||
{
|
||||
case 0: // choose best applicable color format combination
|
||||
{
|
||||
theFormats.Append (theGlContext->hasHalfFloatBuffer ? GL_RGBA16F : GL_RGBA32F);
|
||||
theFormats.Append (theGlContext->hasHalfFloatBuffer ? GL_R16F : GL_R32F);
|
||||
theFormats.Append (theGlContext->hasHalfFloatBuffer != OpenGl_FeatureNotAvailable ? GL_RGBA16F : GL_RGBA32F);
|
||||
theFormats.Append (theGlContext->hasHalfFloatBuffer != OpenGl_FeatureNotAvailable ? GL_R16F : GL_R32F);
|
||||
return true;
|
||||
}
|
||||
case 1: // choose non-optimal applicable color format combination
|
||||
{
|
||||
theFormats.Append (theGlContext->hasHalfFloatBuffer ? GL_RGBA16F : GL_RGBA32F);
|
||||
theFormats.Append (theGlContext->hasHalfFloatBuffer ? GL_RGBA16F : GL_RGBA32F);
|
||||
theFormats.Append (theGlContext->hasHalfFloatBuffer != OpenGl_FeatureNotAvailable ? GL_RGBA16F : GL_RGBA32F);
|
||||
theFormats.Append (theGlContext->hasHalfFloatBuffer != OpenGl_FeatureNotAvailable ? GL_RGBA16F : GL_RGBA32F);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user