When running in a purely swrast environment (such as with
LIBGL_ALWAYS_SOFTWARE), the extension is not exposed by mesa,
but wayland is still possible with wl_shm.
https://bugzilla.gnome.org/show_bug.cgi?id=704750
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 8d4e4b0e8062708cece4d4c929abccc492ee21cc)
Seeing 'fail' in the test reports and the explanation that it means
"Test failed, but it was an expected failure" somewhat gives the
impression that these failures are ok. Actually these failures represent
known bugs/issues that we haven't yet fixed but we don't want them to
result in 'make check' ailing. To try and better reflect the severity of
these issues we now report them as 'FIXME'.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 7934bf3ee4356af160b63084c7192fd2965b5ddd)
It was an oversight when making the CoglAtlasTexture api public that we
continued to use the COGL_TEXTURE_INTERNAL_DEFINE macro. This updates
the code to now use COGL_TEXTURE_DEFINE which means the
cogl_is_atlas_texture() function will now be exported in the public api.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Lionel Landwerlin <llandwerlin@gmail.com>
(cherry picked from commit ecbe209f48be80fe45b48f92b277a2aee08d5704)
The solution files which are updated due to the split of Cogl-Path need
to be pushed as well, which were forgotten. Sorry about this, and fix
.def file generation on Cogl with SDL on Visual Studio 2010 builds.
The recommended usage model for rendering pipelines with minor changes
is to make a copy of a base pipeline just before rendering and then
modify that. The new pipeline can then be used as the base pipeline
for the next paint. Currently this has a known problem when modifying
uniform values in that Cogl won't prune the redundant ancestry and
instead it will end up with an ever-growing chain of pipelines. This
is particularly bad for something like CoglGST where it could also end
up leaking textures for the video frames if the pipelines are used to
render video.
The patch adds a test case for that situation so that we won't forget
about the problem. The test is maked as a known failure. Additionally
the patch adds a similar test for setting the blend constant to
constrast the test with some state that does work correctly.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 2550181543389d6e9e1cb9618d17cd352a0cf9b6)
For some reason the unit test symbols end up in the read-only data
section when building on windows rather than the initialised data
section so they have a different letter in the list generated by nm.
They also begin with an underscore because windows likes to add
underscores to symbols for some reason. This patch changes the regular
expressions in the code to generate the wrapper list so that it
accepts either way.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 8bbd4d49fcbaa2add5fb5d544f2c0a08e7658d36)
The unit tests were failing to build with mingw32 because the
libtest-fixtures was being included both by libcogl and the
test-conformance and test-unit executables. That meant that the
symbols were defined twice and it wouldn't link.
The rule which depends on test-unit being built needs to be called
test-unit.exe on Windows so this patch fixes it to use the $(EXEEXT)
variable to get the right name.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 575bac47fee0b425f4fd30761e5819443e6c045f)
Conflicts:
tests/conform/Makefile.am
tests/unit/Makefile.am
This reverts the change in semantics for cogl_texture_new_with_size so
that it goes back to allocating textures synchronously and returning
NULL if there was a failure to allocate. Only the new/2.0 texture apis
will have the lazy allocation behaviour so we avoid breaking existing
code. This also fixes a potential crasher by removing a code path
that was passing NULL to cogl_texture_allocate() that would have caused
and abort if there were an error.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
This adds a centralized autotools Makefile to be used in the completion
of the project files for Cogl-Path for now, which can be used also in
Cogl, Cogl-Pango and possibly Cogl-Gst so that we could have less clutter
in the autotools files.
This patch set will also allow the Cogl-Path project files to be filled in
during 'make dist' and make them distributed during a tarball release.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 491020592b240ca5f2885dee104c88bf431858ae)
Conflicts:
cogl-path/Makefile.am
This adds a modification to the test-point-sprite test which uses a
shader snippet which directly references cogl_point_coord instead of
relying on cogl_pipeline_set_layer_point_sprite_coords_enabled to
replace the texture coordinates with the point coords.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 5ea57b14f5ec7d52ae378f4ca64574ef56342f56)
This adds a #define for gl_PointCoord to all shaders so that it can be
accessed with a name in the Cogl namespace.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit c28fc054788e88627bcc2346f4c4c368870ff777)
Previously we would only add the #version pragma to shaders when
point sprite texture coordinates are enabled for a layer so that we
can access the gl_PointCoord builtin. However I don't think there's
any good reason not to just always request GLSL version 1.2 if it's
available. That way applications can always use gl_PointCoord without
having to enable point sprite texture coordinates.
This adds a glsl_version_to_use member to CoglContext which is used to
generate the #version pragma as part of the shader boilerplate. On
desktop GL this is set to 120 if version 1.2 is available, otherwise
it is left at 110. On GLES it is always left as 100.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit e4dfe8b07e8af111ecbcb0da20ff2a2875a2b5d0)
Conflicts:
cogl/driver/gl/gl/cogl-driver-gl.c
The documentation for the builtin varyings for the texture coordinates
was wrongly claiming that the varyings are stored in an array. This
was changed in e55b64a9cdc9 so that each layer gets its own
independent varying.
The documentation was also referring to texture units instead of layer
numbers. The texture units are no longer publicly exposed in the
shaders and instead everything should in theory be expressed in terms
of layer numbers.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit bf6b509c340bdc3be30e1a81fb96710b3176e9dc)
The deprecation macros need to be before the function prototype on
Visual Studio, and is also accepted by GCC.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Add the symbols that were added to the public Cogl API, and remove the
export of an internal API that was also removed. Unfortunately
_cogl_system_error_quark needs to be exported for the conformance test
programs.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Cogl-Path was split out from the main Cogl library to become a standalone
library, but many libraries/appplications using Cogl (such as Clutter)
expects that Cogl-Path is still in Cogl. Define
COGL_HAS_COGL_PATH_SUPPORT here, as it will always be needed, at least for
the 1.16 release series, so that builds of items using Cogl would not
break, such as Clutter.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
The autotools variables to substitute for versioning in 1.16 is wrong, so we
have incorrect versioning info during a release as the variables are for
Cogl-2.x. Fix this so we can have the correct versioning info for the
Cogl/Cogl-Pango DLLs during a release.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
This is used for exporting symbols when Cogl-Path becomes a DLL (.so)
of its own, so one can use and process this file with a preprocessor for
e.g. and generate a .def file that can be used for this purpose. Dist the
symbols file as well.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5037d81a1c68cfa9a052b9b081187e717b59b54b)
The cogl-texture-private.h needs to be included as
_cogl_texture_needs_premult_conversion, so that we can avoid implicit
declaration warnings of that symbol (aka C4013 on MSVC).
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 4afe9dc1fea646e2a9576f9a0dbd1ffafa40485b)
This adds template project files that is used to build cogl-path, where the
source files can be filled in using autotools. Note that although
cogl-path is built as a static library, items to build DLLs for this
is intentionally left in there as this is intended to be a shared library
later.
So we don't read an initializes value later on. Caught by valgrind:
Conditional jump or move depends on uninitialised value(s)
_cogl_object_texture_rectangle_indirect_free (cogl-texture-rectangle.c:105)
_cogl_object_context_indirect_free (cogl-context.c:453)
...
main (text.c:149)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 90415aae9495749a2a9e85fb17425a3c7f6a08c8)
Use custom build rules to generate the enumeration sources and the .def
files so that the IDE will regenerate those files upon change and
clean them when a clean up request is requested.
Mesa has started getting picky about specifying the precision for
floating types in the fragment shader. We already have a default
precision specifier in all the fragment shaders but apparently this
wasn't working because it is only used when the __VERSION__ define is
100 and Mesa is reporting 110. Regardless of whether Mesa is doing the
right thing or not I think it makes sense to use GL_ES instead of
__VERSION__ because we will also need the precision specifier if we
start requesting GLSL 3.0. The GLES specification explictly states
that GL_ES will only be defined for GLES and this is similar to what
the internal meta shaders do in Mesa.
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cabd45773b58d6aa482
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 37f5205739cfb0745ea74dedaec117081ba0088b)
Since e07d0fc7441 the COGL_DRIVER environment variable was able to
override the application's driver selection. This doesn't seem like a
good idea because if the application is specifying a driver explicitly
then presumably it can not work with any other driver. This patch
changes it so that if a driver is selected in the configuration and by
the application then they must match, otherwise it will fail with a
CoglError.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 4e0942d74c8d69aa48e0176bfecf27f64a950d0f)
Only COGL_RENDERER_CONSTRAINT_SUPPORTS_COGL_GLES2 affects the driver
selection and all of the the other constraints are only relevant to
the winsys selection. However Cogl was trying to apply all of the
constraints to the driver selection which meant that if any other
constraint was specified then it would always fail. This patch makes
the driver selection filter out all other constraints based on a mask
defined in cogl-renderer-private.h.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit f07febc8913b97fb828e7f2cc2857813af2d3657)
Currently it's only possible to set an onscreen template on a
CoglDisplay by passing a template to cogl_display_new(). For
applications that want to deal with fallbacks then they may want to
replace the onscreen template so this adds a
cogl_display_set_onscreen_template() function.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit f307c9545791dae5472a9568fef6b31b3bf52854)
This updates the static assertion in cogl-renderer.c to only check that
the flags will fit in 32 bits instead of asserting the type has the same
size as an unsigned long.
(cherry picked from commit c6893fa3c9eda0f13b79d3a1fc03f8b79c42a8f6)
WebGL doesn't allow you to separately attach buffers to the
STENCIL_ATTACHMENT and DEPTH_ATTACHMENT framebuffer attachment points
and instead requires you to use the DEPTH_STENCIL_ATTACHMENT whenever
you want a depth and stencil buffer.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit ec7b6360c9c4e45e0b113f9dca7bb1502e7e93be)
This adds a COGL_DRIVER_WEBGL enum and a new driver description for
webgl in cogl-renderer.c. This also adds a COGL_DRIVER_FLAG_OPENGL_WEB
driver flag and a HAVE_COGL_WEBGL define which we can start to use to
handle special cases where webgl differs from gles2.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 2c167b7a4ee56241827322bbe7cb287b0628437c)
This adds a table of driver descriptions to cogl-renderer.c in order of
preference and when choosing what driver to use we now iterate the table
instead of repeating boilerplate checks. For handling the "default driver"
that can be specified when building cogl and handling driver overrides
there is a foreach_driver_description() that will make sure to iterate
the default driver first or if an override has been set then nothing but
the override will be considered.
This patch introduces some driver flags that let us broadly categorize
what kind of GL driver we are currently running on. Since there are
numerous OpenGL apis with different broad feature sets and new apis
may be introduced in the future by Khronos then we should tend to
avoid using the driver id to do runtime feature checking. These flags
provide a more stable quantity for broad feature checks.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit e07d0fc7441dddc3f0a2bc33a6a37d62ddc3efc0)
Add API to allow complex applications using the KMS backend
to go almost straight to direct configuration (which is not possible
because Cogl needs to be in charge of buffers and FB objects).
https://bugzilla.gnome.org/show_bug.cgi?id=705837
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 52fb8e1c33d8c83c731c05cee767928fdd5991d7)
The data->fill_primitive member is meant to be generated on demand in
an accessor function. However when using it for clipping the code was
trying to directly use it without calling the accessor so it would
crash if nothing else caused the primitive to be generated. This was
making the texture-fbo test in Clutter crash.
(cherry picked from commit 0e913664339739812848cdb73bec64c066860e65)