summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/translate/translate.h
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-01-14 18:11:41 +0100
committerMichal Krol <[email protected]>2010-01-14 18:11:41 +0100
commit5184b02b0793136a15b7edf309d79a1efe1bc73d (patch)
tree939f7f87f623b0651e31ea84131c00630ae19f12 /src/gallium/auxiliary/translate/translate.h
parent1bc77e9931a248b74e0ef6b6aa2f4c5b2d1a2ca3 (diff)
parentea0cc47a4f769e19ceadb9704669244f5ba53871 (diff)
Merge branch 'instanced-arrays'
Conflicts: src/gallium/drivers/softpipe/sp_draw_arrays.c
Diffstat (limited to 'src/gallium/auxiliary/translate/translate.h')
-rw-r--r--src/gallium/auxiliary/translate/translate.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/translate/translate.h b/src/gallium/auxiliary/translate/translate.h
index 34526eb0617..54ed2c1a4be 100644
--- a/src/gallium/auxiliary/translate/translate.h
+++ b/src/gallium/auxiliary/translate/translate.h
@@ -44,12 +44,19 @@
#include "pipe/p_format.h"
#include "pipe/p_state.h"
+enum translate_element_type {
+ TRANSLATE_ELEMENT_NORMAL,
+ TRANSLATE_ELEMENT_INSTANCE_ID
+};
+
struct translate_element
{
+ enum translate_element_type type;
enum pipe_format input_format;
enum pipe_format output_format;
unsigned input_buffer:8;
unsigned input_offset:24;
+ unsigned instance_divisor;
unsigned output_offset;
};
@@ -74,11 +81,13 @@ struct translate {
void (PIPE_CDECL *run_elts)( struct translate *,
const unsigned *elts,
unsigned count,
+ unsigned instance_id,
void *output_buffer);
void (PIPE_CDECL *run)( struct translate *,
unsigned start,
unsigned count,
+ unsigned instance_id,
void *output_buffer);
};
@@ -103,8 +112,13 @@ static INLINE int translate_keysize( const struct translate_key *key )
static INLINE int translate_key_compare( const struct translate_key *a,
const struct translate_key *b )
{
- int keysize = translate_keysize(a);
- return memcmp(a, b, keysize);
+ int keysize_a = translate_keysize(a);
+ int keysize_b = translate_keysize(b);
+
+ if (keysize_a != keysize_b) {
+ return keysize_a - keysize_b;
+ }
+ return memcmp(a, b, keysize_a);
}