Chris Sherlock
a2b94b9562
vcl: OpenGL code for adding preambles to glsl fragments now handles #version
...
If you include the #version directive then it must be on the first non-comment
line in a glsl fragment. This is now handled.
Change-Id: I7e938c27b24d20f25e656667a122d7a341f51611
Reviewed-on: https://gerrit.libreoffice.org/14246
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com >
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com >
2015-01-30 03:03:46 +00:00
Luboš Luňák
df290c6345
make it possible to easily have variants of glsl programs
...
Now it's possible to add a preamble to the compiled program, so there can
be just one program with #ifdef's inside and the small variants can be
selected using #define in the preamble instead of having several almost
identical programs.
Change-Id: I6c5112313b91b6269ebdecdfc896e0f96209ea2b
2015-01-27 18:42:48 +01:00
Caolán McNamara
09f38e21c1
coverity#1266483 String not null terminated
...
Change-Id: I4d22e5a621d36fa2e914891e82ce7e8e06f60b4c
2015-01-25 14:36:14 +00:00
Chris Sherlock
fa4327421e
vcl: OpenGLHelper::isVCLOpenGLEnabled() returns false when console only
...
Change-Id: I7bcda46c73b958637073f8ec95d093385a81df3f
2015-01-24 14:27:37 +11:00
Noel Grandin
7f8f277b94
fdo#84938: convert STREAM_ #defines to 'enum class'
...
Change-Id: Ibbf14c7e9a5c1883c1311d4c86f948f74f8e473e
2015-01-07 11:20:44 +02:00
Noel Grandin
54942f0d09
spelling: attachement -> attachment
...
Change-Id: I1bb1ad04adec864b594d96711f85b8fcdc1d1ef2
2015-01-05 12:57:18 +02:00
Markus Mohrhard
ae177f5b99
ifix the OpenGL UI config part
...
Change-Id: I931a4b618f35188e4e0cca07305ff15bbbacc20a
2014-12-18 10:20:12 +01:00
Markus Mohrhard
2a7571d00f
make use of the new ForceOpenGL config variable
...
Change-Id: Ifdfcbd9d3d62d2a55e3e050d4723700f8436e57a
2014-12-17 22:31:16 +01:00
Markus Mohrhard
1fd34cd93f
introduce SAL_FORCEGL and document the variables
...
SAL_FORCEGL can force OpenGL even if the driver is blacklisted.
Change-Id: Idc763d81fef6dbdf915154995205fbf2b1f060b4
2014-12-01 01:30:00 +01:00
Markus Mohrhard
b7d07ffcad
request also a stencil size
...
Change-Id: Ib3b8b70aa50dd1a42108e3e9091350bf1d315b03
2014-11-30 00:47:32 +01:00
Markus Mohrhard
40ad9eea88
implement windows OpenGL blacklist, first step
...
Change-Id: I408b76855693c64473dba3bb3fa94374fff01fae
2014-11-27 21:18:29 +01:00
Markus Mohrhard
a55f740045
include the unx part for getting OpenGL driver & device information
...
desktop/unx/source/glxtest.cxx is taken directly from the Mozilla
project.
THe whole concept is taken from Mozilla and is based on starting an
early process that creates an OpenGL context. This prevents crashing
drivers to crash Libreoffice.
We read the information from the pipe as soon as we create the first vcl
Window. In that place we then decide if the device/driver combination is
blacklisted.
Change-Id: I2624d4ce06d503281a4459cf3174f57cf1f7b733
2014-11-20 13:50:51 +01:00
Michael Meeks
8f1b58b5ac
vcl: fix un-initialized log length & clean copy/paste bits.
...
Change-Id: I39cd9ef32fafa2894ffde961d87adc6aac9d4a4f
2014-11-18 21:26:31 +00:00
Jan Holesovsky
3852d46941
opengl: Do not check for OpenGL errors in a loop.
...
Can lead to an infinite loop.
Change-Id: I09863959719115aec23534ac72a9a9690af3aeb9
2014-11-18 00:51:04 +01:00
Michael Meeks
8ecfdf9c23
vcl: disable OpenGL usage during build.
...
Change-Id: I3a534578df727f2aaab6e36839f0e62e6fc8f208
2014-11-16 17:00:57 +01:00
Jan Holesovsky
1d2c5224b2
opengl: Add many more CHECK_GL_ERROR()'s before returning from functions.
...
Change-Id: I63c147acf9a4013008b0f6d76867186f04ee57d5
2014-11-15 13:51:53 +01:00
Louis-Francis Ratté-Boulianne
f433825259
vcl: Use single-buffer rendering and only flush when necessary
...
Change-Id: I832dd6f3647fbb423975fa928a5ec32447225e85
2014-11-13 07:54:14 +01:00
Markus Mohrhard
4cbd2c0b41
add quick way to enable OpenGL backend through env var
...
Change-Id: I274c76178500c231c1339ac5f0cb7fc084cd1e4b
2014-11-12 06:02:48 +01:00
Michael Meeks
45c6cb5f08
vcl: cleanup the opengl selection API.
...
Change-Id: Icebf3c7d2911b27e29d2259b780a04048b293b3c
2014-11-10 16:51:12 +00:00
Louis-Francis Ratté-Boulianne
4007df6cc8
vcl: Initial work to have native widgets rendered with OpenGL
...
Change-Id: I8b244a5bdd12a64a65ca1bab14dfe6917a175ccf
2014-11-10 07:59:40 +01:00
Michael Meeks
2ad3552308
Make it easy to disable OpenGL in the environment.
...
Change-Id: I9ea0c9f7345e0cbad9ebb51ab724dada7ce77106
2014-11-10 07:59:22 +01:00
Markus Mohrhard
658e76cf95
improve log message when shader compilation fails
...
Change-Id: Ic437302e79d7a192f31f60a674fcfdb38f981d35
2014-11-10 07:59:16 +01:00
Louis-Francis Ratté-Boulianne
42dbcedc73
vcl: Get visual info for window from GLX when needed
...
Change-Id: Id8cea87391835694e20aa703b7fdb3f13434d47b
2014-11-10 07:59:03 +01:00
Markus Mohrhard
5606d14c3e
add possibility to check if system can run OpenGL VCL backend
...
Change-Id: If3475c6b2c76e4634f16053928b43a94c83be6ee
2014-11-10 07:58:40 +01:00
Zolnai Tamás
079c861f08
fdo#81237: 2D OpenGL charts was upside-down
...
The problem is that LO drawinglayer uses a coordinate system
with an origin at the top-left corner of the screen, while
OpenGL uses a complete coordinate system (with all four
quarters, e.g.: allows negative values). The points in
LO are always positive values which means they are drawn
in the first quarter of the OpenGL coordinate system which
also means that the origin is at the bottom-left corner
of the scene. This difference causes the flipped scene.
* To solve that problem scale the projection matrix with -1.0f
along the y axis.
* glDisable(GL_CULL_FACE) is necessary to avoid dropping primitives
after scaling with -1.0.
* Since projection matrix mirrors also the textures we don't need to
do that inside the ConvertBitmapExToRGBATextureBuffer() method.
Change-Id: Ieba642f3e665778a12368fe50a20865ec8f73514
2014-09-17 09:59:50 +02:00
Markus Mohrhard
5a7ab9f1f4
add invalid framebuffer operation to OpenGL error messages
...
Change-Id: I359ec166e9bf0585842fb436a1edd20720b89a9b
2014-09-02 01:08:49 +02:00
Markus Mohrhard
3758286117
check framebuffer status
...
Change-Id: Ieb36804247b4e2790d625585661a1c85586348f1
2014-09-02 01:08:49 +02:00
Markus Mohrhard
276b3d1f8a
extract some shared code
...
Change-Id: I062ea860f695189ab1d59615f1d2390710a21d44
2014-09-02 01:08:48 +02:00
Zolnai Tamás
cde22222cf
Mirror vertically the texture bitmaps for OpenGL
...
In case of glTF models it saves a Mirror() call.
In case of OpenGL charts it avoid flipped texts.
Change-Id: I1ac980e16bcb5ba6a9a025b638aaac3b08b4aab3
2014-08-29 17:40:28 +02:00
Zolnai Tamás
f71aae7501
It seems better if the caller allocates the memory for the RGBA buffer.
...
For example it allows to use std::vector<> and call the method
Change-Id: Id4b8e33838d358dd242d0176e42558505fa8d4a3
2014-08-29 17:40:28 +02:00
Markus Mohrhard
ae1c06be29
improve debug message for shader compilatione errors
...
Change-Id: I14106870bd46c081a574d28f416278b848544fcc
2014-08-15 00:02:50 +02:00
Markus Mohrhard
5ace9183ba
add possibility to generate FBO with texture
...
The caller is responsible to delete the buffers. Depending on bRenderbuffer either with glDeleteRenderbuffers or with glDeleteTextures.
Change-Id: I5ccbd49862c381abf04e812765cced485a083f89
2014-08-08 09:24:00 +02:00
Markus Mohrhard
56d45b721f
make sure that we always delete the shader and not only the program
...
Change-Id: Ia02fb20d335e2172f607f13a0de78ea666d094f5
2014-08-08 09:23:59 +02:00
Caolán McNamara
9ab9d22f82
split helper and fix build
...
Change-Id: Ie479d363152d3c6a109d6e924b09c155c79511c8
2014-07-21 14:50:15 +01:00
Zolnai Tamás
23c876deeb
Extract getGLVersion() method to OpenGLHelper
...
Change-Id: If3b7a6c71164f2b55defe8c28cdce69de9283175
2014-07-21 13:00:08 +02:00
Markus Mohrhard
6612025658
add ostream operator<< for glm::vec3
...
Change-Id: Ic3ce4a647936f3f1c62c2dc3cf37f687d8fbccc1
2014-05-24 10:48:43 +02:00
Markus Mohrhard
a1e7915bfe
Lsan: fix memory leak
...
Change-Id: Id8adb7517960a33f9900cb773b62b84db71e795a
2014-05-23 02:50:42 +02:00
Markus Mohrhard
2bbcf97eb3
fix my issues with the offscreen rendering
...
Change-Id: I4a2ed8a20890119220d63a6768f13365a7b5f97d
2014-05-21 14:24:09 +02:00
Markus Mohrhard
8c39739a38
add method for creating framebuffer objects to OpenGLHelper
...
Change-Id: I08bd2e58ee98a68accae256fcbcc288a8c56ae0b
2014-05-21 01:50:44 +02:00
Markus Mohrhard
5b7dfb07e3
move glm operator<< for debugging to OpenGLHelper
...
Change-Id: Ia529badffe08507d593f494230d2e504b68ff477
2014-05-12 03:00:10 +02:00
Markus Mohrhard
7ffd1af722
move the renderToFile function to the helper to avoid the context
...
Change-Id: I5493126047179d67b2f2ed0d3d5d936ebbaf4810
2014-05-09 00:39:42 +02:00
Tor Lillqvist
47a99f19bb
Add gluErrorString() replacement to OpenGLHelper
...
Change-Id: I1a04ece7026ceff75456df03b4eb189a3cb9687f
2014-04-29 08:27:58 +03:00
Zolnai Tamás
99a034f914
OpenGLHelper: extract BGRA buffer -> BitmepEx conversion
...
Change-Id: I71edb2768d24f0c6686a9c94333447a5acc498b4
2014-04-27 20:27:59 +02:00
Zolnai Tamás
8afabd3942
Extract code of BitmapEx -> RGBA buffer conversion to OpenGLHelper
...
Needed by gltf rendering.
Change-Id: I1aa974f3c515c5fb19a07b54ff655331138553cb
2014-04-18 18:53:22 +02:00
Tor Lillqvist
bf5a6730a5
Avoid complex static global initialisation
...
Caused an assertion failure: "sal/osl/unx/process_impl.cxx:167: sal_uInt32
osl_getCommandArgCount(): Assertion `g_command_args.m_nCount != 0' failed".
Change-Id: Ib01e0312e328f751c9353aab95dceb977b818b0c
2014-04-15 09:53:35 +03:00
Markus Mohrhard
cd56c7bcf3
move some common OpenGL methods to vcl
...
Change-Id: Ic96487afce64bfb0c1dfcc03c088e5d6e1b34ad3
2014-04-15 01:51:28 +02:00