1. 26 Jun, 2012 1 commit
  2. 20 Jun, 2012 3 commits
  3. 19 Jun, 2012 2 commits
  4. 18 Jun, 2012 6 commits
  5. 12 Jun, 2012 1 commit
    • Robert Bragg's avatar
      Adds initial GLES2 integration support · c74692f1
      Robert Bragg authored
      This makes it possible to integrate existing GLES2 code with
      applications using Cogl as the rendering api.
      Currently all GLES2 usage is handled with separate GLES2 contexts to
      ensure that GLES2 api usage doesn't interfere with Cogl's own use of
      OpenGL[ES]. The api has been designed though so we can provide tighter
      integration later.
      The api would allow us to support GLES2 virtualized on top of an
      OpenGL/GLX driver as well as GLES2 virtualized on the core rendering api
      of Cogl itself. Virtualizing the GLES2 support on Cogl will allow us to
      take advantage of Cogl debugging facilities as well as let us optimize
      the cost of allocating multiple GLES2 contexts and switching between
      them which can both be very expensive with many drivers.
      As as a side effect of this patch Cogl can also now be used as a
      portable window system binding API for GLES2 as an alternative to EGL.
      Parts of this patch are based on work done by Tomeu Vizoso
      <tomeu.vizoso@collabora.com> who did the first iteration of adding GLES2
      API support to Cogl so that WebGL support could be added to
      This patch adds a very minimal cogl-gles2-context example that shows how
      to create a gles2 context, clear the screen to a random color and also
      draw a triangle with the cogl api.
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
  6. 10 Jun, 2012 1 commit
  7. 05 Jun, 2012 1 commit
  8. 24 May, 2012 4 commits
    • Robert Bragg's avatar
      Workaround drisw bug where clipped redraws don't work · cb5efc11
      Robert Bragg authored
      This detects when we are running on any of Mesa's software rasterizer
      backends and disables use of glBlitFramebuffer and glXCopySubBuffer.
      Both of these currently result in full-screen copies so there's little
      point in using these to optimize how much of the screen we present.
      To help ensure we re-evaluate this workaround periodically we have added
      a comment marker of "ONGOING BUG" above the workaround and added a note
      to our RELEASING document that says we should grep for this marker and
      write a NEWS section about ongoing bug workarounds.
      https://bugzilla.gnome.org/show_bug.cgi?id=674208Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit 11f2f6eb)
    • Robert Bragg's avatar
      gpu-info: Detect more info including architecture · 51610c3d
      Robert Bragg authored
      The GPU info api previously told us a driver package name and a driver
      vendor name, but now we have introduced detection for the gpu
      architecture too and started to track architecture feature flags that
      can tell us whether a gpu is a deferred or immediate mode renderer for
      example or if a software rasterizer is being used.
      This also adds support for checking more vendor names. We should now
      detect the following cases:
      Vendors: Intel, Imagination Technologies, ARM, Qualcomm, Nvidia, ATI
      Architectures: Sandybridge, SGX, Mali
      Architecture flags:
        - vertex tiled
        - vertex immediate mode
        - vertex software
        - fragment deferred
        - fragment immediate mode
        - fragment software
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      (cherry picked from commit b3803a0a)
    • Neil Roberts's avatar
      Add a workaround for slow read pixels on Mesa · 9a535c20
      Neil Roberts authored
      Mesa before version 8.0.2 has a slow read pixels path that gets used
      with the Intel driver where it converts all of the pixels into a
      floating point representation and back even if the data is being read
      into exactly the same format. There is however a faster path using the
      blitter when reading into a PBO with BGRA format. It works out faster
      to read into a PBO and then memcpy back out into the application's
      buffer even though it adds an extra memcpy. This patch adds a
      workaround in cogl_framebuffer_read_pixels_into_bitmap when it detects
      this situation. In that case it will create a temporary CoglBitmap
      using cogl_bitmap_new_with_size, read into it and then memcpy the data
      back out.
      The main impetus for this patch is that Gnome Shell has implemented
      this workaround directly using GL calls but it seems like the kind of
      thing that would sit better at the Cogl layer.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit cb146dc5)
    • Neil Roberts's avatar
      Add a mechanism for determining GPU driver details · 9c921377
      Neil Roberts authored
      This adds a CoglGpuInfo struct to the CoglContext which contains some
      enums describing the GL driver in use. This currently includes the
      driver package (ie, is it Mesa) the version number of the package and
      the vendor of the GPU (ie, is it by Intel). There is also a bitmask
      which will contain the workarounds that we should do for that
      particular driver configuration. The struct is initialised on context
      creation by using a series of string comparisons on the strings
      returned from glGetString.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 2037e0f4)
  9. 21 May, 2012 2 commits
    • Neil Roberts's avatar
      Cache the debug wireframe snippet · 2f30f1f2
      Neil Roberts authored
      When rendering the debug wireframe Cogl generates a child pipeline of
      the application's pipeline to replace the fragment processing.
      Previously it was creating a new snippet every time something was
      drawn. Cogl doesn't attempt to compare the contents of snippets when
      looking in the program cache for a matching pipeline so this would
      cause it to generate a new program for every primitive. It then quite
      quickly ends printing the warning about there being more than 50
      programs in the cache. To fix that this patch makes it cache the
      snippet so that Cogl can successfully recognise that it already has a
      program generated for the new pipeline.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit c4bb08ee)
    • Neil Roberts's avatar
      Preserve the CoglDrawFlags when drawing a wireframe · 7999c6d6
      Neil Roberts authored
      Previously the CoglDrawFlags passed to
      _cogl_framebuffer_draw_indexed_attributes when drawing is redirected
      to draw a wireframe are overriden to avoid validating the pipeline,
      flushing the framebuffer state and flushing the journal. This ends up
      breaking scenes that only contain models drawn from attributes in the
      application because nothing will flush the matrices. It seems to make
      more sense to just use whatever draw flags were passed from the
      original draw command so that it will flush the matrices if the caller
      was expecting it.
      One problem with this is that if the wireframe causes the journal to
      be flushed then it will already have temporarily disabled the
      wireframe debug flag so the journal will not be drawn with wireframes.
      To fix this the patch adds a CoglDrawFlag to disable the wireframe and
      uses that instead of disabling the debug flag.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 283f6733)
  10. 18 May, 2012 1 commit
    • Neil Roberts's avatar
      Fix disabling debugging · 03163460
      Neil Roberts authored
      When --disable-debug is passed to the configure script it was actually
      still defining COGL_ENABLE_DEBUG so very little would end up being
      disabled. If COGL_ENABLE_DEBUG actually got defined it would also fail
      to compile because _cogl_debug_instances and COGL_DEBUG_N_LONGS from
      cogl-debug.h were only defined if debugging is enabled but they are
      used regardless.
      This patch also makes it so that the _COGL_RETURN_IF_FAIL family of
      macros that are used when glib support is disabled are now disabled if
      debugging is disabled. When the glib macros are used they are already
      disabled because we additionally define G_DISABLE_CHECKS.
      'COGL_HANDLE_DEBUG' has been removed from the list of defines passed
      when debugging is enabled because CoglHandle has already been removed
      and it is not used anywhere in the code.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 9811a010)
  11. 13 May, 2012 1 commit
  12. 06 May, 2012 1 commit
  13. 04 May, 2012 1 commit
  14. 02 May, 2012 1 commit
    • Neil Roberts's avatar
      buffer: Use GL_STREAM_DRAW on GLES2 · 24455f89
      Neil Roberts authored
      The function to convert the CoglBufferUpdateHint to a GL enum was
      previously ifdef'd to only use GL_STREAM_DRAW when Cogl is compiled
      with big GL support. One problem with this is that it would end up
      trying to use it on GLES1 if support for both is compiled. The other
      problem is that GLES2 seems to actually support GL_STREAM_DRAW so we
      might as well use it in that case.
      This patch also changes it so that if the hint is stream with GLES1
      then it will default to GL_DYNAMIC_DRAW instead of GL_STATIC_DRAW
      because I think that is closer to the meaning of the stream hint.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit 9e997476)
  15. 30 Apr, 2012 1 commit
  16. 19 Apr, 2012 3 commits
  17. 18 Apr, 2012 1 commit
  18. 16 Apr, 2012 8 commits
  19. 03 Apr, 2012 1 commit
    • Neil Roberts's avatar
      pipeline: Use cogl_depth_state_init to init default depth state · 1f91ef9a
      Neil Roberts authored
      The previous code to initialise the depth state on the default
      pipeline wasn't initialising the magic number. If you later tried to
      retrieve the depth state using cogl_pipeline_get_depth_state you would
      end up with an invalid depth state struct and you would just get
      warnings if you tried to use it for anything. This patch just replaces
      the initialisation with a call to cogl_depth_state_init because it
      uses the same values anyway.
      Reviewed-by: default avatarRobert Bragg <robert@linux.intel.com>
      (cherry picked from commit be9d5b34)