Commit Graph

1321 Commits

Author SHA1 Message Date
Neil Roberts
8ce5f5ade8 bitmap: Remove the split between 'image library' and 'fallback'
Previously the bitmap code was setup so that there could be an image
library used to convert between formats and then some 'fallback' code
when the image library can't handle the conversion. However there was
never any implementation of the conversion in the image library so the
fallback was always used. I don't think this split really makes sense
so this patch renames cogl-bitmap-fallback to cogl-bitmap-conversion
and removes the stub conversion functions in the image library.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-05 17:44:52 +00:00
Neil Roberts
908ba29be5 bitmap-fallback: Support converting all pixel format types
_cogl_bitmap_fallback_convert now supports converting to and from all
of the pixel formats, except it continues to preserve the premult
status of the original bitmap. The pixels are unpacked into a
temporary buffer that is either 8-bits per component or 16-bits per
component RGBA depending on whether the destination format is going to
use more than 8 bits per component (eg RGBA_1010102). The packing and
unpacking code is stored in a separate header which is included twice
to generate the functions needed for both sizes of unpacked data. The
hope is that when converting between two formats that are both 8-bit
sized, such as swizzling between BGRA and RGBA, then the
multiplications and divisions in the code will be optimized out and it
shouldn't be too inefficient. Previously the inner switch statement to
decide which conversion to use only operated on one pixel at a time so
it was probably relatively slow.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-05 17:44:12 +00:00
Neil Roberts
323adc0c14 Avoid making up the format COGL_PIXEL_FORMAT_A_8_PRE
There are a few places in Cogl that try to set the premult bit on a
pixel format depending on whether it has an alpha channel. However
this breaks if the pixel format is alpha-only because premultiplying
data without any RGB components doesn't make any sense. This adds an
internal macro to check for cases where we should add the premult bit
called COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT. This now gets used in all
places that previously just checking for COGL_A_BIT.

https://bugzilla.gnome.org/show_bug.cgi?id=671016

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-05 17:43:46 +00:00
Neil Roberts
2b9aca20a8 Assert that we get a valid format in pixel_format_to_gl{,es}
The assert could use a 'default:' label but that would stop GCC from
giving a warning when a new enum value is added.

https://bugzilla.gnome.org/show_bug.cgi?id=671016

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-05 17:43:46 +00:00
Neil Roberts
933db01833 cogl-winsys-egl-wayland: Include cogl-wayland-renderer.h
The Wayland winsys defines functions declared in
cogl-wayland-renderer.h so it should include the header to make sure
the declarations are right. This was breaking because currently the
header #defines the _EXP suffixes on to the function names so it would
end up exporting the wrong symbol names.
2012-02-29 17:45:43 +00:00
Robert Bragg
be237cc2b7 renderer: Adds getters/setters for driver preference
This adds api for explicitly choosing what underlying driver cogl should
use internally for rendering as well as api for querying back what
driver is actually in use.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-24 14:42:31 +00:00
Neil Roberts
39c6bf59cb texture: Handle premult conversions when getting texture data
cogl_texture_get_data uses find_best_gl_get_data_format from the
texture driver which returns the closest format to use for retrieving
pixel data given an intended format. However this function doesn't
know about the texture we are reading data from so it doesn't know
that the data we will actually receive will have the same premult
status as the texture's format. With the GL driver, this function ends
up returning exactly the same format as passed in which means it will
never do a premult conversion. Under GLES it always returns
COGL_PIXEL_FORMAT_RGBA_8888 so it will always make the data unpremult
even if the final requested format is premultiplied.

This patch fixes it so that it copies the premult status of the
closest_format from the format of the underlying texture. That way it
will later convert or not depending on the requested target format.

Note this patch breaks test-sub-texture with the GL driver because
that is incorrectly trying to read the texture data back as RGBA_8888
even though it depends on it not doing a premult conversion. The test
was already broken with GLES2 and remains broken.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-23 18:08:45 +00:00
Neil Roberts
31bd4cb22c Use GL_OES_packed_depth_stencil on GLES2
If the GL_OES_packed_depth_stencil extension is available then we can
try creating a combined depth-stencil buffer with the
GL_DEPTH24_STENCIL8 format. This adds a private flag for the feature.

https://bugzilla.gnome.org/show_bug.cgi?id=666184

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-22 17:17:50 +00:00
Neil Roberts
b52d24c933 Check for GL_EXT_packed_depth_stencil
The GL_DEPTH_STENCIL format for renderbuffers is defined in a separate
extension from GL_EXT_framebuffer_object so we probably shouldn't
being trying to use it unless that extension is advertised. This just
replaces the check for whether the driver is GL for a check for a
private feature flag before trying GL_DEPTH_STENCIL. The private
feature flag is set if the extension is available on GL.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-22 17:17:50 +00:00
Neil Roberts
d3e6f2bc83 cogl-attribute: Fix binding an attribute to cogl_tex_coord_in
If an application tries to bind an attribute to cogl_tex_coord_in then
on GLES2 it would try to directly use that as the name of the GL
attribute. However in the generated shader that is actually #defined
to cogl_tex_coord0_in so we need to remap the name. This adds a
parameter to validate_cogl_attribute_name so that it can optionally
return a real_attribute_name. If it doesn't set this then the calling
function will default to the Cogl attribute name.

This fixes test-texture-3d with the GLES2 driver.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-22 17:17:50 +00:00
Chun-wei Fan
2fdb7fc743 cogl-pipeline-payer-state.c: Include cogl-texture-private.h
Needed for _cogl_texture_get_type so that C4013 warnings/implicit
declaration of ... warnings can be avoided.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-22 21:32:52 +08:00
Chun-wei Fan
4eb923a68b Another update to cogl.symbols
The previous update missed renames of certain cogl_framebuffer_* functions
to cogl_onscreen_*, and were not updated as the glib-mkenums-generated
header no longer included experimental headers

Also, all comments in cogl.symbols are now done in C-style so that the
preprocessor will filter them out when processing cogl.symbols instead of
using ';' for commments, which could be MSVC-only

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-22 21:32:42 +08:00
Chun-wei Fan
3d8972342d Revert "Another update to cogl.symbols"
This reverts commit b70af4a104.

Sorry, I missed a comment line in this part :|
2012-02-22 21:31:42 +08:00
Chun-wei Fan
b70af4a104 Another update to cogl.symbols
The previous update missed renames of certain cogl_framebuffer_* functions
to cogl_onscreen_*, and were not updated as the glib-mkenums-generated
header no longer included experimental headers

Also, all comments in cogl.symbols are now done in C-style so that the
preprocessor will filter them out when processing cogl.symbols instead of
using ';' for commments, which could be MSVC-only
2012-02-22 21:30:48 +08:00
Chun-wei Fan
021f4f2624 Update cogl/cogl.symbols
-Make up for the missed cogl_texture_pixmap_x11_* symbols
-Removed texture_3d _EXP suffixes
-For newly-exposed public cogl_pipeline_get_layer_*_filter APIs

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-22 20:30:16 +08:00
Robert Bragg
336c330d11 cogl.h: Exclude 1.x headers if 2.0 api requested
Now if COGL_ENABLE_EXPERIMENTAL_2_0_API has been defined when including
cogl.h then headers that correspond to 1.x only apis that we plan to
drop won't be included any more.

If COGL_ENABLE_EXPERIMENTAL_API is defined then you can still mix and
match 2.0 api with 1.x api in a single compilation unit.

Note: it's still possible that some 1.x symbols will still be available
when COGL_ENABLE_EXPERIMENTAL_2_0_API is defined since this patch
doesn't go through the shared headers adding guards around deprecated
functions.

This only affects people playing with the experimental api.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 13:26:14 +00:00
Robert Bragg
4e3f9d0fc2 tex-pixmap-x11: remove CoglHandle use + pass context
This also replaces use of CoglHandle with a CoglTexturePixmapX11 type
instead.

This patch also ensures the CoglTexturePixmapX11 constructor take an
explicit CoglContext pointer and can return a GError consistent with
other CoglTexture constructors.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 13:26:14 +00:00
Robert Bragg
479c5fd2c9 onscreen: move swap_buffer apis to onscreen namespace
This moves all the cogl_framebuffer_ apis relating to swap buffer
requests into the cogl_onscreen_ namespace since on CoglOnscreen
framebuffers have back buffers that can be swapped.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 13:26:14 +00:00
Robert Bragg
785e6375eb Adds a context arg to cogl_pipeline_new()
As we move towards Cogl 2.0 we are aiming to remove the need for a
default global CoglContext and so everything should be explicitly
related to a context somehow. CoglPipelines are top level objects and
so this patch adds a context argument to cogl_pipeline_new().

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 12:38:24 +00:00
Robert Bragg
13c36fff0d offscreen: Replace use of CoglHandle with CoglOffscreen
This updates cogl_offscreen_new_to_texture to return a CoglOffscreen
pointer instead of a CoglHandle.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 12:38:10 +00:00
Robert Bragg
0a2a3d7c80 context: removes some uses of CoglHandle
There were several members of the CoglContext struct using the
CoglHandle type for things that now have replacement typedefs which
this patch fixes.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 12:37:55 +00:00
Robert Bragg
47868e1f3e texture-3d: remove _EXP defines + CoglHandle and pass context
We are in the process of removing all _EXP suffix mangling for
experimental APIs (Ref: c6528c4b6c) and adding missing gtk-doc
comments so that we can instead rely on the "Stability: unstable"
markers in the gtk-doc comments. This patch tackles the cogl-texture-3d
api symbols.

This patch also replaces use of CoglHandle with a CoglTexture3D type
instead.

Finally this patch also ensures the CoglTexture3D constructors take an
explicit CoglContext pointer but not a CoglTextureFlags argument,
consistent with other CoglTexture constructors.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 12:37:44 +00:00
Robert Bragg
80ccf06b84 debug: support wireframe mode with vertex shaders
Previously for the wireframe debug mode we identified the users
"cogl_position_in" attribute, mapped that, created a replacement
attribute with a LINE_LIST topology and then drew the attribute with a
simple pipeline with a green colour. This meant we completely discarded
the users original pipeline which may have involved vertex processing
that would be useful to visualize in the wireframe.

The new approach instead keeps the users attributes and instead
generates CoglIndices that can be used to refererence the original
attributes in LINE_LIST topology and instead of scrapping the user's
pipeline we now create a weak copy of the original pipeline and just
replace the fragment processing with a snippet to force the output color
to be green.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:32:25 +00:00
Robert Bragg
1bba0f5d99 pipeline: make _equal() cost scale by n bits in differences
This improves the implementation of _cogl_pipeline_equal() to ensure
that the cost of the function scales by the number of bits set in the
pipelines_difference variable set after calling
_cogl_pipeline_compare_differences() instead of scaling by the number of
state groups cogl tracks.

As Cogl tracks more and more state groups we don't want
_cogl_pipeline_equal() to get slower.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:16:37 +00:00
Robert Bragg
ed06d0ca01 object: avoid creating a new entry for NULL data
If setting NULL user data via cogl_object_set_user_data() and we fail to
find an entry for the given key then bail out before potentially
allocating a new entry since setting NULL data is documented to
effectively delete an entry.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:16:37 +00:00
Robert Bragg
31097c0488 pipeline: Expose min/mag filter getters
This exposes cogl_pipeline_get_layer_{min,max}_filter functions so that
applications can query back the filters set using
cogl_pipeline_set_layer_filters().

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:16:37 +00:00
Robert Bragg
680f63a48c Remove all internal includes of cogl.h
The cogl.h header is meant to be the public header for including the 1.x
api used by Clutter so we should stop using that as a convenient way to
include all likely prototypes and typedefs. Actually we already do a
good job of listing the specific headers we depend on in each of the .c
files we have so mostly this patch just strip out the redundant
includes for cogl.h with a few fixups where that broke the build.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Robert Bragg
cc4aa97579 Handle all formats in _cogl_texture_driver_pixel_format_to_gl
The _cogl_texture_driver_pixel_format_to_gl functions for OpenGL and
OpenGLES convert CoglPixelFormats into corresponding gl enums that can
be used to upload texture data. Previously we were only handling a few
specific formats but this patch updates the functions to handle all the
formats we know about. The functions now also switch() on the format so
that we will get build time warnings if we forget to handle new formats
in these functions.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Damien Leone
c8674ef2bc Add support for X101010 and 2101010 pixel formats to fallback OpenGL rendering
https://bugzilla.gnome.org/show_bug.cgi?id=660188

edit: tweaked the internal format returned by pixel_format_to_gl();
handled 1010102 formats and rebased -- Robert Bragg

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Damien Leone
8b70468598 Improve pixel format detection for fallback OpenGL rendering
The previous detection was based on bits per pixel only and would
consider bpp >= 24 as X888 or 8888 24-bit color depth formats.

This commit ensures we now use the newly added
_cogl_util_pixel_format_from_masks() api that returns a CoglPixelFormat
according to channel masks and color depth. This helps to add support
for more pixel formats.

https://bugzilla.gnome.org/show_bug.cgi?id=660188

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Robert Bragg
e3c4522a86 Adds a _cogl_util_pixel_format_from_masks API
This adds a utility function for inferring a CoglPixelFormat from a
set of channel masks, a bits-per-pixel value, a pixel-depth value and
pixel byte order.

This plan is to use this to improve how we map X visuals to Cogl pixel
formats.

This patch was based on some ideas from Damien Leone <dleone@nvidia.com>

https://bugzilla.gnome.org/show_bug.cgi?id=660188

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Robert Bragg
fcb8b18d39 pixel formats: Documents the internal representation
This adds a comment to cogl-types.h where we define all the
CoglPixelFormat enums to give lots of information about the internal
representation of the format and to explain how new formats should be
allocated.

This information came from the discussion in bug #660188

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Damien Leone
f3fa86b482 Add 30-bit color depth pixel formats X101010 and 2101010
30-bit color depth formats are defined by using value 13 in the least
significant nibble of the pixel format enumeration. This nibble
encodes bytes-per-pixel and byte alignment.

The _cogl_pixel_format_get_bytes_per_pixl() function is updated
accordingly to support these new formats.

https://bugzilla.gnome.org/show_bug.cgi?id=660188

edit: dropped the X101010 formats but also added 1010102 formats since
Cogl avoids exposing any padded formats and leaves it to applications to
consider the A component to be padding as needed. -- Robert Bragg

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Robert Bragg
5cdc9af18a Removes the COGL_PIXEL_FORMAT_{24,32} defines
Although these are in the public headers we should assume that no one is
using them since they were never documented so no could know what they
are useful for.

If you were to guess you'd be forgiven for thinking they were bitmasks
for checking some flags to see if a format is 24 or 32 bits. If you
looked further you might instead be forgiven for thinking that if you
masked of the least significant nibble of a pixel-format then you could
check the value against these defines. Neither of the previous
operations are reliable ways to check if a format is 24 or 32bit and
instead code must use then internal
_cogl_pixel_format_get_bytes_per_pixel() api if they want to know the
pixel size for a given format which relies on a 16 entry lookup table
using the least significant nibble of a pixel-format.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Robert Bragg
e43246fe1c Remove COGL_UNORDERED_MASK define
Although it's in a public header nothing should be using this define
since it's not documented what it could be used for. The cases where we
were using it internally were quite fragile because they were trying to
mask information from the least significant nibble of CoglPixelFormat
but really that nibble just has to be dealt with using lookup tables.
The least significant nibble of a pixel format gives information about
the bytes per pixel and whether the components are byte aligned but the
information needs to be accessed using
_cogl_pixel_format_get_byes_per_pixel() and
_cogl_pixel_format_is_endian_dependant().

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Robert Bragg
a203a5e396 Remove COGL_UNPREMULT_MASK define
Since (A & ~COGL_PREMULT_BIT) is basically as readable as (A &
COGL_UNPREMULT_MASK) this patch removes the mask define. Without the
mask the code is slightly more explicit and there's less risk in error
caused by us forgetting to update the COGL_UNPREMULT_MASK if the way
CoglPixelFormat is defined evolves.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Robert Bragg
07e972505c Adds _cogl_pixel_format_is_endian_dependant api
This adds an internal utility function
_cogl_pixel_format_is_endian_dependant() that can query whether
accessing the components of a given format depends on the endianness of
the current host CPU or whether a pixel can be loaded as a word and
channels accessed using bit masking and shifting.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Robert Bragg
fbec2a5ad7 moves and renames _cogl_get_format_bpp
This moves _cogl_get_format_bpp from cogl-bitmap.c to cogl.c and renames
it to _cogl_pixel_format_get_bytes_per_pixel. This makes it clearer that
it doesn't return bits per pixel and makes the naming consistent with
other cogl api. The prototype has been moved to cogl-private.h since it
seems we should be aiming to get rid of cogl-internal.h at some point.

The patch also adds a simple gtk-doc comment since we might want to make
this api public.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Robert Bragg
e376058533 cogl-private.h: include cogl-context.h
cogl-private.h contains prototypes depending on CoglContext so
explicitly include cogl-context.h

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Robert Bragg
ee940a3d0d Move all types/prototypes from cogl.h -> cogl[1]-context.h
So we can get to the point where cogl.h is merely an aggregation of
header includes for the 1.x api this moves all the function prototypes
and type definitions into a cogl-context.h and a new cogl1-context.h.

Ideally no code internally should ever need to include cogl.h as it just
represents the public facing header for accessing the 1.x api which
should only be used by Clutter.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Robert Bragg
1022c285c6 texture-pixmap-x11.h: define __COGL_H_INSIDE__
Ideally we wouldn't have exposed cogl-texture-pixmap-x11.h as a
top level header and would have just automatically included it in cogl.h
but we already have code that assumes it can be directly included.

This ensures we define __COGL_H_INSIDE__ as a reminder that it is a top
level header in case we later need to include other cogl internal cogl
headers which would cause a build time error without this defined.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Robert Bragg
9c58d6c4e7 Clean up cogl 1.x/2.0 header separation
The cogl_public_h variable in cogl/Makefile.am was a mixture of 1.x
headers and experimental headers which meant that glib-mkenums was
processing lots of experimental api headers. This patch lists
experimental api headers under the cogl_experimental_h variable instead.
This patch also ensures we undef the COGL_ENABLE_EXPERIMENTAL_* defines
when running the gobject introspection scanner for Cogl-1.0.gir

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Emmanuele Bassi
3f561b1fbe Fix build on OSX
A missing include prevents Cogl from building on OSX.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-15 14:57:59 +00:00
Chun-wei Fan
2059d2dee0 Update cogl.symbols
Add cogl_pipline_set_layer_null_texture... which was just added to the COGL
API

Checked with Neil Roberts <neil@linux.intel.com> on IRC.
2012-02-15 22:50:09 +08:00
Jasper St. Pierre
e98f279712 Fix some doc issues
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-14 20:42:10 +00:00
Neil Roberts
f84839e87c pipeline-state: Fix crash in the get_all_uniform_values function
The get_all_uniform_values function tries to walk the parent hierarchy
of pipelines to find pipelines overriding the uniforms state and then
grabs the values from the override. However it was accessing data
inside the ‘big state’ even if the pipeline didn't override the
uniforms state so it would crash if it encountered a parent pipeline
with no big state.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-13 18:48:17 +00:00
Neil Roberts
6ddf81c8dc Pass the sampler object to snippet hooks on the texture_hookup
The snippet hook COGL_SNIPPET_HOOK_TEXTURE_LOOKUP now gets passed an
extra variable called cogl_sampler which is the sampler attached to
this layer. For example this will be useful when implementing the blur
effect in Clutter so that it can make the texture hook for that layer
sample the texture multiple times.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-13 17:29:28 +00:00
Robert Bragg
2caf9e0f59 glsl: always emit sampler uniforms for non NULL layers
There might be custom hooks that want to sample arbitrary layers
even though they aren't referenced as part of the auto generated layer
combine code. This ensures the sampler uniforms are always output for
non-null layers so at least these can be used.

We may consider changing this later to always emit a wrapper
cogl_sampleX() function for each layer so all samples of a layer can
consistently be modified by a COGL_SNIPPET_HOOK_TEXTURE_LOOKUP hook.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-13 17:29:20 +00:00
Neil Roberts
aa9c293502 glsl: Use layer numbers not unit numbers for builtin uniforms
When generating GLSL code, the names of the builtin uniforms for the
sampler and the layer constant have been renamed to use the layer
number not the unit number. This will make it easier if we ever want
to make them public.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-13 17:15:35 +00:00
Neil Roberts
e6b3bfa41a pipeline: Use layer numbers not unit numbers in the combine strings
In a combine string the application can specify TEXTURE_? as a source
to sample from the texture attached to a particular unit. The number
specified here was being interpreted as a unit index. This is not
helpful to applications because theoretically the unit index is an
internal implementation detail so they can't reliably determine what
it is. This patch changes them to be interpreted as layer indices
instead.

To make this work the enums in CoglPipelineCombineSource are no longer
directly mapped to GLenums. Otherwise it implies a low limit on the
number of layer indices because there are only 32 reserved numbers
between GL_TEXTURE0 and GL_ACTIVE_TEXTURE.

This also fixes a bug in the ARBfp fragend where it was generating
code using the texture type of the layer doing the referencing rather
than the layer that was being referenced.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-13 17:15:35 +00:00