use ;
use crate Color;
use ;
// typedef struct
// {
// GList *entries;
// } PipelineSnippetList;
// Arguments to pass to _pipeline_snippet_generate_code() */
// typedef struct
// {
// PipelineSnippetList *snippets;
// /* Only snippets at this hook point will be used */
// SnippetHook hook;
// /* The final fn to chain on to after all of the snippets code
// has been run */
// const char *chain_function;
// /* The name of the final generated fn */
// const char *final_name;
// /* A prefix to insert before each generate fn name */
// const char *function_prefix;
// /* The return type of all of the functions, or NULL to use void */
// const char *return_type;
// /* A variable to return from the functions. The snippets are
// expected to modify this variable. Ignored if return_type is
// NULL */
// const char *return_variable;
// /* If this is true then it won't allocate a separate variable for
// the return value. Instead it is expected that the snippet will
// modify one of the argument variables directly and that will be
// returned */
// Bool return_variable_is_argument;
// /* The argument names or NULL if there are none */
// const char *arguments;
// /* The argument types or NULL */
// const char *argument_declarations;
// /* The string to generate the source into */
// GString *source_buf;
// } PipelineSnippetData;
// XXX: should I rename these as
// * PIPELINE_STATE_INDEX_XYZ... ?
// */
// typedef enum
// {
// /* sparse state */
// PIPELINE_STATE_COLOR_INDEX,
// PIPELINE_STATE_BLEND_ENABLE_INDEX,
// PIPELINE_STATE_LAYERS_INDEX,
// PIPELINE_STATE_LIGHTING_INDEX,
// PIPELINE_STATE_ALPHA_FUNC_INDEX,
// PIPELINE_STATE_ALPHA_FUNC_REFERENCE_INDEX,
// PIPELINE_STATE_BLEND_INDEX,
// PIPELINE_STATE_USER_SHADER_INDEX,
// PIPELINE_STATE_DEPTH_INDEX,
// PIPELINE_STATE_FOG_INDEX,
// PIPELINE_STATE_NON_ZERO_POINT_SIZE_INDEX,
// PIPELINE_STATE_POINT_SIZE_INDEX,
// PIPELINE_STATE_PER_VERTEX_POINT_SIZE_INDEX,
// PIPELINE_STATE_LOGIC_OPS_INDEX,
// PIPELINE_STATE_CULL_FACE_INDEX,
// PIPELINE_STATE_UNIFORMS_INDEX,
// PIPELINE_STATE_VERTEX_SNIPPETS_INDEX,
// PIPELINE_STATE_FRAGMENT_SNIPPETS_INDEX,
// /* non-sparse */
// PIPELINE_STATE_REAL_BLEND_ENABLE_INDEX,
// PIPELINE_STATE_COUNT
// } PipelineStateIndex;
// Used in pipeline->differences masks and for notifying pipeline
// * state changes.
// *
// * XXX: If you add or remove state groups here you may need to update
// * some of the state masks following this enum too!
// *
// * FIXME: perhaps it would be better to rename this enum to
// * PipelineStateGroup to better convey the fact that a single enum
// * here can map to multiple properties.
// */
// typedef enum _PipelineState
// {
// PIPELINE_STATE_COLOR =
// 1L<<PIPELINE_STATE_COLOR_INDEX,
// PIPELINE_STATE_BLEND_ENABLE =
// 1L<<PIPELINE_STATE_BLEND_ENABLE_INDEX,
// PIPELINE_STATE_LAYERS =
// 1L<<PIPELINE_STATE_LAYERS_INDEX,
// PIPELINE_STATE_LIGHTING =
// 1L<<PIPELINE_STATE_LIGHTING_INDEX,
// PIPELINE_STATE_ALPHA_FUNC =
// 1L<<PIPELINE_STATE_ALPHA_FUNC_INDEX,
// PIPELINE_STATE_ALPHA_FUNC_REFERENCE =
// 1L<<PIPELINE_STATE_ALPHA_FUNC_REFERENCE_INDEX,
// PIPELINE_STATE_BLEND =
// 1L<<PIPELINE_STATE_BLEND_INDEX,
// PIPELINE_STATE_USER_SHADER =
// 1L<<PIPELINE_STATE_USER_SHADER_INDEX,
// PIPELINE_STATE_DEPTH =
// 1L<<PIPELINE_STATE_DEPTH_INDEX,
// PIPELINE_STATE_FOG =
// 1L<<PIPELINE_STATE_FOG_INDEX,
// PIPELINE_STATE_NON_ZERO_POINT_SIZE =
// 1L<<PIPELINE_STATE_NON_ZERO_POINT_SIZE_INDEX,
// PIPELINE_STATE_POINT_SIZE =
// 1L<<PIPELINE_STATE_POINT_SIZE_INDEX,
// PIPELINE_STATE_PER_VERTEX_POINT_SIZE =
// 1L<<PIPELINE_STATE_PER_VERTEX_POINT_SIZE_INDEX,
// PIPELINE_STATE_LOGIC_OPS =
// 1L<<PIPELINE_STATE_LOGIC_OPS_INDEX,
// PIPELINE_STATE_CULL_FACE =
// 1L<<PIPELINE_STATE_CULL_FACE_INDEX,
// PIPELINE_STATE_UNIFORMS =
// 1L<<PIPELINE_STATE_UNIFORMS_INDEX,
// PIPELINE_STATE_VERTEX_SNIPPETS =
// 1L<<PIPELINE_STATE_VERTEX_SNIPPETS_INDEX,
// PIPELINE_STATE_FRAGMENT_SNIPPETS =
// 1L<<PIPELINE_STATE_FRAGMENT_SNIPPETS_INDEX,
// PIPELINE_STATE_REAL_BLEND_ENABLE =
// 1L<<PIPELINE_STATE_REAL_BLEND_ENABLE_INDEX,
// } PipelineState;
// typedef enum
// {
// PIPELINE_LIGHTING_STATE_PROPERTY_AMBIENT = 1,
// PIPELINE_LIGHTING_STATE_PROPERTY_DIFFUSE,
// PIPELINE_LIGHTING_STATE_PROPERTY_SPECULAR,
// PIPELINE_LIGHTING_STATE_PROPERTY_EMISSION,
// PIPELINE_LIGHTING_STATE_PROPERTY_SHININESS
// } PipelineLightingStateProperty;
// typedef struct
// {
// /* Standard OpenGL lighting model attributes */
// float ambient[4];
// float diffuse[4];
// float specular[4];
// float emission[4];
// float shininess;
// } PipelineLightingState;
// typedef struct
// {
// /* Determines what fragments are discarded based on their alpha */
// PipelineAlphaFunc alpha_func;
// float alpha_func_reference;
// } PipelineAlphaFuncState;
// typedef enum _PipelineBlendEnable
// {
// /* XXX: we want to detect users mistakenly using true or false
// * so start the enum at 2. */
// PIPELINE_BLEND_ENABLE_ENABLED = 2,
// PIPELINE_BLEND_ENABLE_DISABLED,
// PIPELINE_BLEND_ENABLE_AUTOMATIC
// } PipelineBlendEnable;
// typedef struct
// {
// /* Determines how this pipeline is blended with other primitives */
// #if defined(HAVE_GLES2) || defined(HAVE_GL)
// GLenum blend_equation_rgb;
// GLenum blend_equation_alpha;
// GLint blend_src_factor_alpha;
// GLint blend_dst_factor_alpha;
// Color blend_constant;
// #endif
// GLint blend_src_factor_rgb;
// GLint blend_dst_factor_rgb;
// } PipelineBlendState;
// typedef struct
// {
// Bool enabled;
// Color color;
// FogMode mode;
// float density;
// float z_near;
// float z_far;
// } PipelineFogState;
// typedef struct
// {
// ColorMask color_mask;
// } PipelineLogicOpsState;
// typedef struct
// {
// PipelineCullFaceMode mode;
// Winding front_winding;
// } PipelineCullFaceState;
// typedef struct
// {
// Bitmask override_mask;
// /* This is an array of values. Only the uniforms that have a bit set
// in override_mask have a corresponding value here. The uniform's
// location is implicit from the order in this array */
// BoxedValue *override_values;
// /* Uniforms that have been modified since this pipeline was last
// flushed */
// Bitmask changed_mask;
// } PipelineUniformsState;
// typedef struct
// {
// PipelineLightingState lighting_state;
// PipelineAlphaFuncState alpha_state;
// PipelineBlendState blend_state;
// Handle user_program;
// DepthState depth_state;
// PipelineFogState fog_state;
// float point_size;
// unsigned int non_zero_point_size : 1;
// unsigned int per_vertex_point_size : 1;
// PipelineLogicOpsState logic_ops_state;
// PipelineCullFaceState cull_face_state;
// PipelineUniformsState uniforms_state;
// PipelineSnippetList vertex_snippets;
// PipelineSnippetList fragment_snippets;
// } PipelineBigState;
// typedef struct
// {
// Pipeline *owner;
// PipelineLayer *layer;
// } PipelineLayerCacheEntry;
// typedef struct _PipelineHashState
// {
// unsigned long layer_differences;
// PipelineEvalFlags flags;
// unsigned int hash;
// } PipelineHashState;
// typedef struct _PipelineFragend
// {
// void (*start) (Pipeline *pipeline,
// int n_layers,
// unsigned long pipelines_difference);
// Bool (*add_layer) (Pipeline *pipeline,
// PipelineLayer *layer,
// unsigned long layers_difference);
// Bool (*passthrough) (Pipeline *pipeline);
// Bool (*end) (Pipeline *pipeline,
// unsigned long pipelines_difference);
// void (*pipeline_pre_change_notify) (Pipeline *pipeline,
// PipelineState change,
// const Color *new_color);
// void (*pipeline_set_parent_notify) (Pipeline *pipeline);
// void (*layer_pre_change_notify) (Pipeline *owner,
// PipelineLayer *layer,
// PipelineLayerState change);
// } PipelineFragend;
// typedef struct _PipelineVertend
// {
// void (*start) (Pipeline *pipeline,
// int n_layers,
// unsigned long pipelines_difference);
// Bool (*add_layer) (Pipeline *pipeline,
// PipelineLayer *layer,
// unsigned long layers_difference,
// Framebuffer *framebuffer);
// Bool (*end) (Pipeline *pipeline,
// unsigned long pipelines_difference);
// void (*pipeline_pre_change_notify) (Pipeline *pipeline,
// PipelineState change,
// const Color *new_color);
// void (*layer_pre_change_notify) (Pipeline *owner,
// PipelineLayer *layer,
// PipelineLayerState change);
// } PipelineVertend;
// typedef struct
// {
// int vertend;
// int fragend;
// Bool (*start) (Pipeline *pipeline);
// void (*end) (Pipeline *pipeline,
// unsigned long pipelines_difference);
// void (*pipeline_pre_change_notify) (Pipeline *pipeline,
// PipelineState change,
// const Color *new_color);
// void (*layer_pre_change_notify) (Pipeline *owner,
// PipelineLayer *layer,
// PipelineLayerState change);
// /* This is called after all of the other functions whenever the
// pipeline is flushed, even if the pipeline hasn't changed since
// the last flush */
// void (* pre_paint) (Pipeline *pipeline, Framebuffer *framebuffer);
// } PipelineProgend;
// typedef enum
// {
// PIPELINE_PROGRAM_TYPE_GLSL = 1,
// PIPELINE_PROGRAM_TYPE_ARBFP,
// PIPELINE_PROGRAM_TYPE_FIXED
// } PipelineProgramType;
// typedef enum
// {
// PIPELINE_GET_LAYER_NO_CREATE = 1<<0
// } PipelineGetLayerFlags;
//
// * PipelineFlushFlag:
// * @PIPELINE_FLUSH_FALLBACK_MASK: The fallback_layers member is set to
// * a uint32_t mask of the layers that can't be supported with the user
// * supplied texture and need to be replaced with fallback textures. (1 =
// * fallback, and the least significant bit = layer 0)
// * @PIPELINE_FLUSH_DISABLE_MASK: The disable_layers member is set to
// * a uint32_t mask of the layers that you want to completly disable
// * texturing for (1 = fallback, and the least significant bit = layer 0)
// * @PIPELINE_FLUSH_LAYER0_OVERRIDE: The layer0_override_texture member is
// * set to a GLuint OpenGL texture name to override the texture used for
// * layer 0 of the pipeline. This is intended for dealing with sliced
// * textures where you will need to point to each of the texture slices in
// * turn when drawing your geometry. Passing a value of 0 is the same as
// * not passing the option at all.
// * @PIPELINE_FLUSH_SKIP_GL_COLOR: When flushing the GL state for the
// * pipeline don't call glColor.
// */
// typedef enum _PipelineFlushFlag
// {
// PIPELINE_FLUSH_FALLBACK_MASK = 1L<<0,
// PIPELINE_FLUSH_DISABLE_MASK = 1L<<1,
// PIPELINE_FLUSH_LAYER0_OVERRIDE = 1L<<2,
// PIPELINE_FLUSH_SKIP_GL_COLOR = 1L<<3
// } PipelineFlushFlag;
// /*
// * PipelineFlushOptions:
// *
// */
// typedef struct _PipelineFlushOptions
// {
// PipelineFlushFlag flags;
// uint32_t fallback_layers;
// uint32_t disable_layers;
// Texture *layer0_override_texture;
// } PipelineFlushOptions;
// typedef struct
// {
// /* Total number of pipelines that were ever added to the hash. This
// * is not decremented when a pipeline is removed. It is only used to
// * generate a warning if an unusually high number of pipelines are
// * generated */
// int n_unique_pipelines;
// /* This is the expected minimum size we could prune the hash table
// * to if we were to remove all pipelines that are not in use. This
// * is only updated after we prune the table */
// int expected_min_size;
// /* String that will be used to describe the usage of this hash table
// * in the debug warning when too many pipelines are generated. This
// * must be a static string because it won't be copied or freed */
// const char *debug_string;
// unsigned int main_state;
// unsigned int layer_state;
// GHashTable *table;
// } PipelineHashTable;
// typedef struct
// {
// Pipeline *pipeline;
// /* Number of usages of this template. If this drops to zero then it
// * will be a candidate for removal from the cache */
// int usage_count;
// } PipelineCacheEntry;
// XXX: should I rename these as
// * PIPELINE_LAYER_STATE_INDEX_XYZ... ?
// */
// typedef enum
// {
// /* sparse state */
// PIPELINE_LAYER_STATE_UNIT_INDEX,
// PIPELINE_LAYER_STATE_TEXTURE_TYPE_INDEX,
// PIPELINE_LAYER_STATE_TEXTURE_DATA_INDEX,
// PIPELINE_LAYER_STATE_SAMPLER_INDEX,
// PIPELINE_LAYER_STATE_COMBINE_INDEX,
// PIPELINE_LAYER_STATE_COMBINE_CONSTANT_INDEX,
// PIPELINE_LAYER_STATE_USER_MATRIX_INDEX,
// PIPELINE_LAYER_STATE_POINT_SPRITE_COORDS_INDEX,
// PIPELINE_LAYER_STATE_VERTEX_SNIPPETS_INDEX,
// PIPELINE_LAYER_STATE_FRAGMENT_SNIPPETS_INDEX,
// /* note: layers don't currently have any non-sparse state */
// PIPELINE_LAYER_STATE_SPARSE_COUNT,
// PIPELINE_LAYER_STATE_COUNT = PIPELINE_LAYER_STATE_SPARSE_COUNT
// } PipelineLayerStateIndex;
// /* XXX: If you add or remove state groups here you may need to update
// * some of the state masks following this enum too!
// *
// * FIXME: perhaps it would be better to rename this enum to
// * PipelineLayerStateGroup to better convey the fact that a single
// * enum here can map to multiple properties.
// */
// typedef enum
// {
// PIPELINE_LAYER_STATE_UNIT =
// 1L<<PIPELINE_LAYER_STATE_UNIT_INDEX,
// PIPELINE_LAYER_STATE_TEXTURE_TYPE =
// 1L<<PIPELINE_LAYER_STATE_TEXTURE_TYPE_INDEX,
// PIPELINE_LAYER_STATE_TEXTURE_DATA =
// 1L<<PIPELINE_LAYER_STATE_TEXTURE_DATA_INDEX,
// PIPELINE_LAYER_STATE_SAMPLER =
// 1L<<PIPELINE_LAYER_STATE_SAMPLER_INDEX,
// PIPELINE_LAYER_STATE_COMBINE =
// 1L<<PIPELINE_LAYER_STATE_COMBINE_INDEX,
// PIPELINE_LAYER_STATE_COMBINE_CONSTANT =
// 1L<<PIPELINE_LAYER_STATE_COMBINE_CONSTANT_INDEX,
// PIPELINE_LAYER_STATE_USER_MATRIX =
// 1L<<PIPELINE_LAYER_STATE_USER_MATRIX_INDEX,
// PIPELINE_LAYER_STATE_POINT_SPRITE_COORDS =
// 1L<<PIPELINE_LAYER_STATE_POINT_SPRITE_COORDS_INDEX,
// PIPELINE_LAYER_STATE_VERTEX_SNIPPETS =
// 1L<<PIPELINE_LAYER_STATE_VERTEX_SNIPPETS_INDEX,
// PIPELINE_LAYER_STATE_FRAGMENT_SNIPPETS =
// 1L<<PIPELINE_LAYER_STATE_FRAGMENT_SNIPPETS_INDEX,
// /* PIPELINE_LAYER_STATE_TEXTURE_INTERN = 1L<<8, */
// } PipelineLayerState;
// typedef enum
// {
// /* These are the same values as GL */
// PIPELINE_COMBINE_FUNC_ADD = 0x0104,
// PIPELINE_COMBINE_FUNC_ADD_SIGNED = 0x8574,
// PIPELINE_COMBINE_FUNC_SUBTRACT = 0x84E7,
// PIPELINE_COMBINE_FUNC_INTERPOLATE = 0x8575,
// PIPELINE_COMBINE_FUNC_REPLACE = 0x1E01,
// PIPELINE_COMBINE_FUNC_MODULATE = 0x2100,
// PIPELINE_COMBINE_FUNC_DOT3_RGB = 0x86AE,
// PIPELINE_COMBINE_FUNC_DOT3_RGBA = 0x86AF
// } PipelineCombineFunc;
// typedef enum
// {
// /* Note that these numbers are deliberately not the same as the GL
// numbers so that we can reserve all numbers > TEXTURE0 to store
// very large layer numbers */
// PIPELINE_COMBINE_SOURCE_TEXTURE,
// PIPELINE_COMBINE_SOURCE_CONSTANT,
// PIPELINE_COMBINE_SOURCE_PRIMARY_COLOR,
// PIPELINE_COMBINE_SOURCE_PREVIOUS,
// PIPELINE_COMBINE_SOURCE_TEXTURE0
// } PipelineCombineSource;
// typedef enum
// {
// /* These are the same values as GL */
// PIPELINE_COMBINE_OP_SRC_COLOR = 0x0300,
// PIPELINE_COMBINE_OP_ONE_MINUS_SRC_COLOR = 0x0301,
// PIPELINE_COMBINE_OP_SRC_ALPHA = 0x0302,
// PIPELINE_COMBINE_OP_ONE_MINUS_SRC_ALPHA = 0x0303
// } PipelineCombineOp;
// typedef struct
// {
// /* The texture combine state determines how the color of individual
// * texture fragments are calculated. */
// PipelineCombineFunc texture_combine_rgb_func;
// PipelineCombineSource texture_combine_rgb_src[3];
// PipelineCombineOp texture_combine_rgb_op[3];
// PipelineCombineFunc texture_combine_alpha_func;
// PipelineCombineSource texture_combine_alpha_src[3];
// PipelineCombineOp texture_combine_alpha_op[3];
// float texture_combine_constant[4];
// /* The texture matrix dscribes how to transform texture coordinates */
// Matrix matrix;
// PipelineSnippetList vertex_snippets;
// PipelineSnippetList fragment_snippets;
// Bool point_sprite_coords;
// } PipelineLayerBigState;
// struct _PipelineLayer
// {
// /* XXX: Please think twice about adding members that *have* be
// * initialized during a _pipeline_layer_copy. We are aiming
// * to have copies be as cheap as possible and copies may be
// * done by the primitives APIs which means they may happen
// * in performance critical code paths.
// *
// * XXX: If you are extending the state we track please consider if
// * the state is expected to vary frequently across many pipelines or
// * if the state can be shared among many derived pipelines instead.
// * This will determine if the state should be added directly to this
// * structure which will increase the memory overhead for *all*
// * layers or if instead it can go under ->big_state.
// */
// /* Layers represent their state in a tree structure where some of
// * the state relating to a given pipeline or layer may actually be
// * owned by one if is ancestors in the tree. We have a common data
// * type to track the tree heirachy so we can share code... */
// Node _parent;
// /* Some layers have a pipeline owner, which is to say that the layer
// * is referenced in that pipelines->layer_differences list. A layer
// * doesn't always have an owner and may simply be an ancestor for
// * other layers that keeps track of some shared state. */
// Pipeline *owner;
// /* The lowest index is blended first then others on top */
// int index;
// /* A mask of which state groups are different in this layer
// * in comparison to its parent. */
// unsigned int differences;
// /* Common differences
// *
// * As a basic way to reduce memory usage we divide the layer
// * state into two groups; the minimal state modified in 90% of
// * all layers and the rest, so that the second group can
// * be allocated dynamically when required.
// */
// /* Each layer is directly associated with a single texture unit */
// int unit_index;
// /* The type of the texture. This is always set even if the texture
// is NULL and it will be used to determine what type of texture
// lookups to use in any shaders generated by the pipeline
// backends. */
// TextureType texture_type;
// /* The texture for this layer, or NULL for an empty
// * layer */
// Texture *texture;
// const SamplerCacheEntry *sampler_cache_entry;
// /* Infrequent differences aren't currently tracked in
// * a separate, dynamically allocated structure as they are
// * for pipelines... */
// PipelineLayerBigState *big_state;
// /* bitfields */
// /* Determines if layer->big_state is valid */
// unsigned int has_big_state:1;
// };
// typedef enum {
// PIPELINE_LAYER_TYPE_TEXTURE
// } PipelineLayerType;
//*
// * PipelineFilter:
// * @PIPELINE_FILTER_NEAREST: Measuring in manhatten distance from the,
// * current pixel center, use the nearest texture texel
// * @PIPELINE_FILTER_LINEAR: Use the weighted average of the 4 texels
// * nearest the current pixel center
// * @PIPELINE_FILTER_NEAREST_MIPMAP_NEAREST: Select the mimap level whose
// * texel size most closely matches the current pixel, and use the
// * %PIPELINE_FILTER_NEAREST criterion
// * @PIPELINE_FILTER_LINEAR_MIPMAP_NEAREST: Select the mimap level whose
// * texel size most closely matches the current pixel, and use the
// * %PIPELINE_FILTER_LINEAR criterion
// * @PIPELINE_FILTER_NEAREST_MIPMAP_LINEAR: Select the two mimap levels
// * whose texel size most closely matches the current pixel, use
// * the %PIPELINE_FILTER_NEAREST criterion on each one and take
// * their weighted average
// * @PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR: Select the two mimap levels
// * whose texel size most closely matches the current pixel, use
// * the %PIPELINE_FILTER_LINEAR criterion on each one and take
// * their weighted average
// *
// * Texture filtering is used whenever the current pixel maps either to more
// * than one texture element (texel) or less than one. These filter enums
// * correspond to different strategies used to come up with a pixel color, by
// * possibly referring to multiple neighbouring texels and taking a weighted
// * average or simply using the nearest texel.
// */
// typedef enum {
// PIPELINE_FILTER_NEAREST = 0x2600,
// PIPELINE_FILTER_LINEAR = 0x2601,
// PIPELINE_FILTER_NEAREST_MIPMAP_NEAREST = 0x2700,
// PIPELINE_FILTER_LINEAR_MIPMAP_NEAREST = 0x2701,
// PIPELINE_FILTER_NEAREST_MIPMAP_LINEAR = 0x2702,
// PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR = 0x2703
// } PipelineFilter;
// /* NB: these values come from the equivalents in gl.h */
// /**
// * PipelineWrapMode:
// * @PIPELINE_WRAP_MODE_REPEAT: The texture will be repeated. This
// * is useful for example to draw a tiled background.
// * @PIPELINE_WRAP_MODE_CLAMP_TO_EDGE: The coordinates outside the
// * range 0→1 will sample copies of the edge pixels of the
// * texture. This is useful to avoid artifacts if only one copy of
// * the texture is being rendered.
// * @PIPELINE_WRAP_MODE_AUTOMATIC: will try to automatically
// * decide which of the above two to use. For rectangle(), it
// * will use repeat mode if any of the texture coordinates are
// * outside the range 0→1, otherwise it will use clamp to edge. For
// * polygon() it will always use repeat mode. For
// * vertex_buffer_draw() it will use repeat mode except for
// * layers that have point sprite coordinate generation enabled. This
// * is the default value.
// *
// * The wrap mode specifies what happens when texture coordinates
// * outside the range 0→1 are used. Note that if the filter mode is
// * anything but %PIPELINE_FILTER_NEAREST then texels outside the
// * range 0→1 might be used even when the coordinate is exactly 0 or 1
// * because OpenGL will try to sample neighbouring pixels. For example
// * if you are trying to render the full texture then you may get
// * artifacts around the edges when the pixels from the other side are
// * merged in if the wrap mode is set to repeat.
// *
// * Since: 2.0
// */
// /* GL_ALWAYS is just used here as a value that is known not to clash
// * with any valid GL wrap modes
// *
// * XXX: keep the values in sync with the PipelineWrapModeInternal
// * enum so no conversion is actually needed.
// */
// typedef enum {
// PIPELINE_WRAP_MODE_REPEAT = 0x2901,
// PIPELINE_WRAP_MODE_MIRRORED_REPEAT = 0x8370,
// PIPELINE_WRAP_MODE_CLAMP_TO_EDGE = 0x812F,
// PIPELINE_WRAP_MODE_AUTOMATIC = 0x0207 /* GL_ALWAYS */
// } PipelineWrapMode;