summaryrefslogtreecommitdiff
path: root/cogl/cogl-attribute-private.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-08-06 21:19:27 +0100
committerRobert Bragg <robert@linux.intel.com>2013-01-22 17:48:07 +0000
commit6e379fb54ef0a6539dc175e1af1bb4200743c856 (patch)
tree715adb3d4f0fed898747502aa47f1859fbdb08cc /cogl/cogl-attribute-private.h
parent56ae6f9afa308377b70d4a6d34bac9a6f5c261d5 (diff)
downloadcogl-6e379fb54ef0a6539dc175e1af1bb4200743c856.tar.gz
attribute: Adds support for constant CoglAttributes
This makes it possible to create vertex attributes that efficiently represent constant values without duplicating the constant for every vertex. This adds the following new constructors for constant attributes: cogl_attribute_new_const_1f cogl_attribute_new_const_2fv cogl_attribute_new_const_3fv cogl_attribute_new_const_4fv cogl_attribute_new_const_2f cogl_attribute_new_const_3f cogl_attribute_new_const_4f cogl_attribute_new_const_2x2fv cogl_attribute_new_const_3x3fv cogl_attribute_new_const_4x4fv Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 6507216f8030e84dcf2e63b8ecfe906ac47f2ca7)
Diffstat (limited to 'cogl/cogl-attribute-private.h')
-rw-r--r--cogl/cogl-attribute-private.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/cogl/cogl-attribute-private.h b/cogl/cogl-attribute-private.h
index beb5609b..d38f4e6c 100644
--- a/cogl/cogl-attribute-private.h
+++ b/cogl/cogl-attribute-private.h
@@ -32,6 +32,7 @@
#include "cogl-attribute.h"
#include "cogl-framebuffer.h"
#include "cogl-pipeline-private.h"
+#include "cogl-boxed-value.h"
typedef enum
{
@@ -55,14 +56,25 @@ struct _CoglAttribute
{
CoglObject _parent;
- CoglAttributeBuffer *attribute_buffer;
const CoglAttributeNameState *name_state;
- size_t stride;
- size_t offset;
- int n_components;
- CoglAttributeType type;
CoglBool normalized;
+ CoglBool is_buffered;
+
+ union {
+ struct {
+ CoglAttributeBuffer *attribute_buffer;
+ size_t stride;
+ size_t offset;
+ int n_components;
+ CoglAttributeType type;
+ } buffered;
+ struct {
+ CoglContext *context;
+ CoglBoxedValue boxed;
+ } constant;
+ } d;
+
int immutable_ref;
};