mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0029509: Visualization, TKOpenGl - Weighted OIT + MSAA shader compilation errors
Fix implicit cast ivec2->vec2 and specify GLSL version to "320 es" on appropriate devices.
This commit is contained in:
parent
c5a65111c4
commit
e3744452bb
@ -1345,7 +1345,7 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramOitCompositing (const St
|
|||||||
EOL
|
EOL
|
||||||
EOL"void main()"
|
EOL"void main()"
|
||||||
EOL"{"
|
EOL"{"
|
||||||
EOL" ivec2 aTexel = ivec2 (textureSize (uAccumTexture) * TexCoord);"
|
EOL" ivec2 aTexel = ivec2 (vec2 (textureSize (uAccumTexture)) * TexCoord);"
|
||||||
EOL" vec4 aAccum = texelFetch (uAccumTexture, aTexel, gl_SampleID);"
|
EOL" vec4 aAccum = texelFetch (uAccumTexture, aTexel, gl_SampleID);"
|
||||||
EOL" float aWeight = texelFetch (uWeightTexture, aTexel, gl_SampleID).r;"
|
EOL" float aWeight = texelFetch (uWeightTexture, aTexel, gl_SampleID).r;"
|
||||||
EOL" occSetFragColor (vec4 (aAccum.rgb / max (aWeight, 0.00001), aAccum.a));"
|
EOL" occSetFragColor (vec4 (aAccum.rgb / max (aWeight, 0.00001), aAccum.a));"
|
||||||
@ -1356,9 +1356,13 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramOitCompositing (const St
|
|||||||
aProgramSrc->SetHeader ("#version 400");
|
aProgramSrc->SetHeader ("#version 400");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (myContext->IsGlGreaterEqual (3, 0))
|
if (myContext->IsGlGreaterEqual (3, 2))
|
||||||
{
|
{
|
||||||
aProgramSrc->SetHeader ("#version 300 es");
|
aProgramSrc->SetHeader ("#version 320 es");
|
||||||
|
}
|
||||||
|
else if (myContext->IsGlGreaterEqual (3, 0))
|
||||||
|
{
|
||||||
|
aProgramSrc->SetHeader ("#version 300 es"); // with GL_OES_sample_variables extension
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user