1. 02 Sep, 2016 1 commit
    • Lionel Landwerlin's avatar
      Add precision for Sampler3D · 651972c8
      Lionel Landwerlin authored
      GLES spec 3.0 - 4.5.4 Default Precision Qualifiers
      defines the default precisions as follow for the vertex shaders :
      precision highp float;
      precision highp int;
      precision lowp sampler2D;
      precision lowp samplerCube;
      and for the fragment shaders :
      precision mediump int;
      precision lowp sampler2D;
      precision lowp samplerCube;
      Therefore we need to set the Sampler3D precision in both vertex & fragment
      This also reverts :
      "conform: Disable 3D textures on GLES"
      commit ea34b9d7.
  2. 26 Aug, 2016 1 commit
    • Emmanuele Bassi's avatar
      conform: Disable 3D textures on GLES · ea34b9d7
      Emmanuele Bassi authored
      It has started to consistently fail when using the GLES driver, but
      since there isn't anybody left to debug it, we should simply disable
      the unit on anything that isn't big GL.
  3. 23 Jul, 2015 1 commit
  4. 10 Jun, 2015 2 commits
  5. 20 Jan, 2014 1 commit
    • Neil Roberts's avatar
      Add support for RG textures · eb7ef457
      Neil Roberts authored
      order to support two-component textures. The RG components for a
      texture is only supported if COGL_FEATURE_ID_TEXTURE_RG is advertised.
      This is only available on GL 3, GL 2 with the GL_ARB_texture_rg
      extension or GLES with the GL_EXT_texture_rg extension. The RG pixel
      format is always supported for images because Cogl can easily do the
      conversion if an application uses this format to upload to a texture
      with a different format.
      If an application tries to create an RG texture when the feature isn't
      supported then it will raise an error when the texture is allocated.
      https://bugzilla.gnome.org/show_bug.cgi?id=712830Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 568677ab)
  6. 13 Jan, 2014 1 commit
    • Robert Bragg's avatar
      texture-rectangle: update _new_with_size in line with master · a77dc131
      Robert Bragg authored
      This updates the cogl_texture_rectangle_new_with_size() api in line with
      master to be consistent with other texture constructors. This removes
      the internal_format and error arguments and allows the texture to be
      allocated lazily which means the texture can be configured with apis
      like cogl_texture_set_components() and cogl_texture_set_premultiplied()
      before it is allocated.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
  7. 09 Jan, 2014 1 commit
    • Robert Bragg's avatar
      remove internal_format and redundant error arguments · af739878
      Robert Bragg authored
      Texture allocation is now consistently handled lazily such that the
      internal format can now be controlled using
      cogl_texture_set_components() and cogl_texture_set_premultiplied()
      before allocating the texture with cogl_texture_allocate(). This means
      that the internal_format arguments to texture constructors are now
      redundant and since most of the texture constructors now can't ever fail
      the error arguments are also redundant. This now means we no longer
      use CoglPixelFormat in the public api for describing the internal format
      of textures which had been bad solution originally due to how specific
      CoglPixelFormat is which is missleading when we don't support such
      explicit control over the internal format.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 99a53c82)
      Note: there are numerous API changes for functions currently marked
      as 'unstable' which we don't think are in use by anyone depending on
      a stable 1.x api. Compared to the original patch though this avoids
      changing the cogl_texture_rectangle_new_with_size() api which we know
      is used by Mutter.
  8. 03 Dec, 2013 2 commits
  9. 27 Nov, 2013 1 commit
    • Robert Bragg's avatar
      Declare interface types as void and remove cast macros · 6436cd07
      Robert Bragg authored
      This declares the interface types CoglFramebuffer, CoglBuffer,
      CoglTexture, CoglMetaTexture and CoglPrimitiveTexture as void when
      including the public cogl.h header so that users don't have to use lots
      of C type casts between instance types and interface types.
      This also removes all of the COGL_XYZ() type cast macros since they do
      nothing more than compile time type casting but it's less readable if
      you haven't seen that coding pattern before.
      Unlike with gobject based apis that use per-type macros for casting and
      performing runtime type checking we instead prefer to do our runtime
      type checking internally within the front-end public apis when objects
      are passed into Cogl. This greatly reduces the verbosity for users of
      the api and may help reduce the chance of excessive runtime type
      checking that can sometimes be a problem.
      (cherry picked from commit 248a76f5)
      Since we can't break the 1.x api this version of the patch actually
      defines compatible NOP macros within deprecated/cogl-type-casts.h
  10. 28 Oct, 2013 2 commits
    • Hans Petter Jansson's avatar
      Add API to control per-framebuffer depth writing · a8e04a7d
      Hans Petter Jansson authored
      Add framebuffer methods cogl_framebuffer_[gs]et_depth_write_enabled()
      and backend bits to pass the state on to glDepthMask().
      This allows us to enable or disable depth writing per-framebuffer, which
      if disabled saves us some work in glClear(). When rendering, the flag
      is combined with the pipeline's depth writing flag using a logical AND.
      Depth writing is enabled by default.
      https://bugzilla.gnome.org/show_bug.cgi?id=709827Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 71406438)
    • Robert Bragg's avatar
      conform: check we invalidate ancestor cached state · 99a0be89
      Robert Bragg authored
      In the cases where we cache vertex state with an ancestor pipeline (whose
      vertex processing state is equivalent) we need to invalidate that state
      if that ancestor is later modified.
      This conformance test checks this case but currently fails because we
      only notify the progend directly associated with the pipeline being
      In this case the pipeline can be using a different progend to the
      ancestor which it is caching state with so when the ancestor is changed
      it needs to notify all the progends that they may need to clear their
      private state.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit e112af5f)
  11. 06 Sep, 2013 1 commit
    • Robert Bragg's avatar
      tests: use 'FIXME' instead of 'fail' for expected failures · 176ac7e2
      Robert Bragg authored
      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: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 7934bf3e)
  12. 02 Sep, 2013 3 commits
    • Neil Roberts's avatar
      Fix generating the unit test wrappers when building with MingW32 · 9c224439
      Neil Roberts authored
      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: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 8bbd4d49)
    • Neil Roberts's avatar
      Fix building the conformance and unit tests on mingw32 · 4d98bdd9
      Neil Roberts authored
      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: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 575bac47)
    • Neil Roberts's avatar
      Add a conformance test for using cogl_point_coord in a shader · a849ecae
      Neil Roberts authored
      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: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 5ea57b14)
  13. 19 Aug, 2013 3 commits
    • Robert Bragg's avatar
      gl: bind position attribute to location 0 · 04d94357
      Robert Bragg authored
      Full GL treats the position attribute specially and requires that it
      must be bound to generic attribute location 0 unlike GLES 2.0 or
      GL 3.2 core. We now make sure to unconditionally bind the
      cogl_position_in attribute to location 0 before linking any glsl program
      in cogl.
      For reference the relevant part of the GL 3.0 spec that covers these
      semantics is Section 2.7 "Vertex Specification" pg 27
      After this change there was one remaining problem in
      test-custom-attributes where the test_short_verts() test was using its
      own "pos" attribute instead of cogl_position_in and so cogl wasn't able
      to ensure it would be bound to location 0.
      This updates the test to use cogl_position_in but to work around the
      fact that glVertexPointer doesn't support UNSIGNED_SHORT components we
      force the test to use the glsl backend by setting a shader snippet on
      the pipeline.
      https://bugs.freedesktop.org/show_bug.cgi?id=67548Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 992ef7b3)
    • Robert Bragg's avatar
      offscreen: rename _new_to_texture to _new_with_texture · 1317a25a
      Robert Bragg authored
      This renames cogl_offscreen_new_to_texture to
      cogl_offscreen_new_with_texture. The intention is to then cherry-pick
      this back to the cogl-1.16 branch so we can maintain a parallel
      cogl_offscreen_new_to_texture() function which keeps the synchronous
      allocation semantics that some clutter applications are currently
      relying on.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit ecc6d2f6)
      Note: Since we can't break the 1.x api on this branch this keeps a
      thin shim around cogl_offscreen_new_with_texture to implement
      cogl_offscreen_new_to_texture with its synchronous allocation
    • Robert Bragg's avatar
      Separate out CoglPath api into sub-library · 7365c3aa
      Robert Bragg authored
      This splits out the cogl_path_ api into a separate cogl-path sub-library
      like cogl-pango and cogl-gst. This enables developers to build Cogl with
      this sub-library disabled if they don't need it which can be useful when
      its important to keep the size of an application and its dependencies
      down to a minimum. The functions cogl_framebuffer_{fill,stroke}_path
      have been renamed to cogl_path_{fill,stroke}.
      There were a few places in core cogl and cogl-gst that referenced the
      CoglPath api and these have been decoupled by using the CoglPrimitive
      api instead. In the case of cogl_framebuffer_push_path_clip() the core
      clip stack no longer accepts path clips directly but it's now possible
      to get a CoglPrimitive for the fill of a path and so the implementation
      of cogl_framebuffer_push_path_clip() now lives in cogl-path and works as
      a shim that first gets a CoglPrimitive and uses
      cogl_framebuffer_push_primitive_clip instead.
      We may want to consider renaming cogl_framebuffer_push_path_clip to
      put it in the cogl_path_ namespace.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 8aadfd82)
      So as to avoid breaking the 1.x API or even the ABI since we are quite
      late in the 1.16 development cycle the patch was modified to build
      cogl-path as a noinst_LTLIBRARY before building cogl and link the code
      directly into libcogl.so as it was previously. This way we can wait
      until the start of the 1.18 cycle before splitting the code into a
      separate libcogl-path.so.
      This also adds shims for cogl_framebuffer_fill/stroke_path() to avoid
      breaking the 1.x API/ABI.
  14. 30 Jul, 2013 1 commit
  15. 29 Jul, 2013 2 commits
    • Robert Bragg's avatar
      Add _primitive_draw to replace _framebuffer_draw_primitive · e9f72121
      Robert Bragg authored
      When splitting out the CoglPath api we saw that we would be left with
      inconsistent drawing apis if the drawing apis in core Cogl were lumped
      into the cogl_framebuffer_ api considering other Cogl sub-libraries or
      that others will want to create higher level drawing apis outside of
      Cogl but can't use the same namespace.
      So that we can aim for a more consistent style this adds a
      cogl_primitive_draw() api, comparable to cogl_path_fill() or
      cogl_pango_show_layout() that's intended to replace
      Note: the attribute and rectangle drawing apis are still in the
      cogl_framebuffer_ namespace and this might potentially change but in
      these cases there is no single object representing the thing being drawn
      so it seems a more reasonable they they live in the framebuffer
      namespace for now.
      Note: the cogl_framebuffer_draw_primitive() api isn't removed by this
      patch so it can more conveniently be cherry picked to the 1.16 branch so
      we can mark it deprecated for a short while. Even though it's marked as
      experimental api we know that there are people using the api so we'd
      like to give them a chance to switch to the new api.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 418912b9)
    • Robert Bragg's avatar
      tests: stop using cogl-auto-texture apis · 93733799
      Robert Bragg authored
      The plan is to remove the cogl-auto-texture apis since they hide a bit
      too much from developers but currently the conformance tests depend on
      these apis in numerous places.
      For the conformance tests it makes some sense to continue using high
      level texture apis similar to the auto-texture apis since we may want
      to make broad variations to how textures are allocated as part of the
      testing running if that might help exercise more code paths.
      This patch copies much of the auto-texture functionality into some
      slightly more special purpose utilities in test-utils.c/h. Minor changes
      include being constrained to the public Cogl api and they also don't
      let you catch CoglErrors and just assume they should abort on error.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 911df797)
  16. 09 Jul, 2013 2 commits
  17. 04 Jul, 2013 1 commit
    • Neil Roberts's avatar
      Don't include cogl/cogl.h from test-utils.h · b1542cf9
      Neil Roberts authored
      There was a circular depedency when building from a fresh git clone
      where test-fixtures needs to be built before the cogl directory, but
      test-fixtures also indirectly includes cogl-enum-types.h which is only
      generated when building the cogl directory. If we change the header to
      just include specific cogl headers instead of cogl/cogl.h then we can
      break the circular dependency.
      This needs a tweak to test-no-gl-header because that first undefines
      COGL_COMPILATION before including test-utils.h. However it doesn't
      really do any actual work so we can get away without including it.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit adb26bd1)
  18. 02 Jul, 2013 1 commit
  19. 21 Jun, 2013 1 commit
    • Neil Roberts's avatar
      Set G_DEBUG=fatal-warnings in run-tests.sh · 3ccd22b9
      Neil Roberts authored
      We want any run-time warnings to cause the conformance tests to fail.
      We are currently setting G_DEBUG in test_utils_init and this would
      previously cause the fatal-warnings debug option to be set. However
      since commit 47444dac of glib this no longer works because the
      environment variable is read in a magic constructor of libglib so it
      is too late to try to set it there. This patch makes it also set it in
      run-tests.sh to avoid the problem.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 95a6d962)
  20. 13 Jun, 2013 2 commits
  21. 12 Jun, 2013 1 commit
    • Neil Roberts's avatar
      Use GModule instead of libdl to load unit test symbols · e6fb1fb4
      Neil Roberts authored
      Previously the unit tests were using libdl without directly linking to
      it. It looks like this ends up working because one of Cogl's
      dependencies ends up pulling adding -ldl via libtool. However in some
      configurations it looks like this wasn't happening.
      To avoid this problem we can just use GModule to resolve the symbols.
      g_module_open is documented to return a handle to the ‘main program’
      when NULL is passed as the filename and looking at the code it seems
      that this ends up using RTLD_DEFAULT so it will have the same effect.
      The in-tree copy of glib already has the code for gmodule so this
      shouldn't cause problems for --disable-glib.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit b14ece11)
  22. 07 Jun, 2013 1 commit
    • Neil Roberts's avatar
      Add support for per-vertex point sizes · 6d51a18e
      Neil Roberts authored
      This adds a new function to enable per-vertex point size on a
      pipeline. This can be set with
      cogl_pipeline_set_per_vertex_point_size(). Once enabled the point size
      can be set either by drawing with an attribute named
      'cogl_point_size_in' or by writing to the 'cogl_point_size_out'
      builtin from a snippet.
      There is a feature flag which must be checked for before using
      per-vertex point sizes. This will only be set on GL >= 2.0 or on GLES
      2.0. GL will only let you set a per-vertex point size from GLSL by
      writing to gl_PointSize. This is only available in GL2 and not in the
      older GLSL extensions.
      The per-vertex point size has its own pipeline state flag so that it
      can be part of the state that affects vertex shader generation.
      Having to enable the per vertex point size with a separate function is
      a bit awkward. Ideally it would work like the color attribute where
      you can just set it for every vertex in your primitive with
      cogl_pipeline_set_color or set it per-vertex by just using the
      attribute. This is harder to get working with the point size because
      we need to generate a different vertex shader depending on what
      attributes are bound. I think if we wanted to make this work
      transparently we would still want to internally have a pipeline
      property describing whether the shader was generated with per-vertex
      support so that it would work with the shader cache correctly.
      Potentially we could make the per-vertex property internal and
      automatically make a weak pipeline whenever the attribute is bound.
      However we would then also need to automatically detect when an
      application is writing to cogl_point_size_out from a snippet.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 8495d9c1)
  23. 06 Jun, 2013 3 commits
    • Robert Bragg's avatar
      units: remove test-bitmask and add UNIT_TEST instead · d264b300
      Robert Bragg authored
      This moves the code in test-bitmask into a UNIT_TEST() directly in
      cogl-bitmask.c which will now be run as a tests/unit/ test.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 693c85e0)
      Includes fix to build conform tests with -I$(top_builddir)/cogl to
      be able to find cogl-gl-header.h
    • Robert Bragg's avatar
      tests: Adds our first white-box unit test · eb7fafe7
      Robert Bragg authored
      This adds a white-box unit test that verifies that GL_BLEND is disabled
      when drawing an opaque rectangle, enabled when drawing a transparent
      rectangle and then disabled again when drawing a transparent rectangle
      but with a blend string that effectively disables blending.
      This shares the test utilities and launcher infrastructure we are using
      for conformance tests so we get consistent reporting and so unit tests
      will be run against a range of different drivers.
      This adds a --enable-unit-tests configure option which is enabled by
      default but if disabled will make all UNIT_TESTS() into static inline
      functions that we should expect the compiler to discard since they won't
      be referenced by anything.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 9047cce0)
    • Robert Bragg's avatar
      conform: Add color attribute based blending test · f4fd724c
      Robert Bragg authored
      This adds a test to make sure that if the same pipeline is used to draw
      two primitives, one which doesn't need blending because it has an opaque
      color associated, and another using a color attribute that requires
      blending then Cogl should recognize that it needs to enable blending for
      the second primitive even though the pipeline hasn't changed.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit c15d91f1)
  24. 29 May, 2013 1 commit
    • Robert Bragg's avatar
      Adds initial Emscripten support to Cogl · 0e7a632e
      Robert Bragg authored
      This enables basic Emscripten support in Cogl via the SDL winsys.
      Assuming you have setup an emscripten toolchain you can configure Cogl
      like this:
       emconfigure ./configure --enable-debug --enable-emscripten
      Building the examples will build .html files that can be loaded directly
      by a WebGL enabled browser.
      Note: at this point the emscripten support has just barely been smoke
      tested so it's expected that as we continue to build on this we will
      learn about more things we need to change in Cogl to full support this
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit a3bc2e75)
  25. 28 May, 2013 1 commit
  26. 24 Apr, 2013 1 commit
    • Robert Bragg's avatar
      Add compiler deprecation warnings · afbb13e1
      Robert Bragg authored
      This adds compiler symbol deprecation declarations for old Cogl APIs so
      that users can easily see via compiler warning when they are using these
      symbols, and also see a hint for what the apis should be replaced with.
      So that users of Cogl can manage when to show these warnings this
      introduces a scheme borrowed from glib whereby you can declare what
      version of the Cogl api you are using:
      COGL_VERSION_MIN_REQUIRED can be defined to indicate the oldest Cogl api
      that the application wants to use. Cogl will only warn about
      deprecations for symbols that were deprecated earlier than this required
      version. If this is left undefined then by default Cogl will warn about
      all deprecations.
      COGL_VERSION_MAX_ALLOWED can be defined to indicate the newest api
      that the application uses. If the application uses symbols newer than
      this then Cogl will give a warning about that.
      This patch removes the need to maintain the COGL_DISABLE_DEPRECATED
      guards around deprecated symbols.
      This patch fixes a few uses of deprecated symbols in the examples/
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
  27. 23 Apr, 2013 1 commit
  28. 04 Apr, 2013 1 commit
    • Neil Roberts's avatar
      pipeline-cache: Use a special trimmed down pipeline for the key · 20657d62
      Neil Roberts authored
      When a pipeline is added to the cache, a normal copy would previously be
      made to use as the key in the hash table. This copy keeps a reference
      to the real pipeline which means all of the resources it contains are
      retained forever, even if they aren't necessary to generate the hash.
      This patch changes it to create a trimmed down copy that only has the
      state necessary to generate the hash. A new function called
      _cogl_pipeline_deep_copy is added which makes a new pipeline that is
      directly a child of the root pipeline. It then copies over the
      pertinent state from the original pipeline. The pipeline state is
      copied using the existing _cogl_pipeline_copy_differences function.
      There was no equivalent function for the layer state so I have added
      That way the pipeline key doesn't have the texture data state and it
      doesn't hold a reference to the original pipeline so it should be much
      cheaper to keep around.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit e27e01c1)