[Libreoffice-commits] core.git: vcl/opengl
Tor Lillqvist
tml at collabora.com
Tue May 31 13:39:16 UTC 2016
vcl/opengl/win/gdiimpl.cxx | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
New commits:
commit e971a7192c81c4db84192c6a545dc045aab1a37d
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue May 31 16:11:35 2016 +0300
tdf#100159: Use shader preambles as needed, add missing shader combinations
Some shaders are in some cases (or always?) compiled with a preamble,
so add that then as applicable when compiling and caching them in
advance.
Add a few shader combinations that I hadn't noticed.
Change-Id: Ib66027e03a36cd4b161fe9f57ceaa338f9fb042d
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 163d2db..6c4f7f6 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -353,7 +353,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
namespace
{
-bool tryShaders(const OUString& rVertexShader, const OUString& rFragmentShader, const OUString& rGeometryShader = "")
+bool tryShaders(const OUString& rVertexShader, const OUString& rFragmentShader, const OUString& rGeometryShader = "", const OString& rPreamble = "")
{
GLint nId;
@@ -362,9 +362,14 @@ bool tryShaders(const OUString& rVertexShader, const OUString& rFragmentShader,
// only of the combination of vertex and fragment (but not geometry) shader. So if we have a
// geometry shader, we should not save the binary.
if (rGeometryShader.isEmpty())
- nId = OpenGLHelper::LoadShaders(rVertexShader, rFragmentShader, rGeometryShader, "", OpenGLHelper::GetDigest( rVertexShader, rFragmentShader, ""));
+ {
+ nId = OpenGLHelper::LoadShaders(rVertexShader, rFragmentShader, rPreamble, OpenGLHelper::GetDigest( rVertexShader, rFragmentShader, rPreamble));
+ }
else
+ {
+ assert(rPreamble.isEmpty());
nId = OpenGLHelper::LoadShaders(rVertexShader, rFragmentShader, rGeometryShader);
+ }
if (!nId)
return false;
glDeleteProgram(nId);
@@ -420,11 +425,17 @@ bool compiledShaderBinariesWork()
tryShaders("textureVertexShader", "areaScaleFragmentShader") &&
tryShaders("transformedTextureVertexShader", "maskedTextureFragmentShader") &&
tryShaders("transformedTextureVertexShader", "areaScaleFastFragmentShader") &&
+ tryShaders("transformedTextureVertexShader", "areaScaleFastFragmentShader", "", "#define MASKED") &&
tryShaders("transformedTextureVertexShader", "areaScaleFragmentShader") &&
+ tryShaders("transformedTextureVertexShader", "areaScaleFragmentShader", "", "#define MASKED") &&
tryShaders("transformedTextureVertexShader", "textureFragmentShader") &&
tryShaders("combinedTextureVertexShader", "combinedTextureFragmentShader") &&
+ tryShaders("combinedTextureVertexShader", "combinedTextureFragmentShader", "", "// flush shader\n") &&
tryShaders("textureVertexShader", "linearGradientFragmentShader") &&
tryShaders("textureVertexShader", "radialGradientFragmentShader") &&
+ tryShaders("textureVertexShader", "areaHashCRC64TFragmentShader") &&
+ tryShaders("textureVertexShader", "replaceColorFragmentShader") &&
+ tryShaders("textureVertexShader", "greyscaleFragmentShader") &&
tryShaders("textureVertexShader", "textureFragmentShader") &&
tryShaders("textureVertexShader", "convolutionFragmentShader") &&
tryShaders("textureVertexShader", "areaScaleFastFragmentShader") &&
More information about the Libreoffice-commits
mailing list