diff options
author | Dave Airlie <[email protected]> | 2015-03-18 11:46:45 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2015-03-20 09:46:30 +1000 |
commit | 9d97cd2e3e993658ebe038f4652dc59c3ae56031 (patch) | |
tree | bd9d4bb966d4515aa1c7abe51998a8de540ee086 /src/gallium/auxiliary/indices/u_indices.h | |
parent | 201aef9d1370ff524f856b725d2328c4f48199e8 (diff) |
u_primconvert: add primitive restart support
This add primitive restart support to the prim conversion.
This involves changing the API for the translate functions
as we need to pass the prim restart index and the original
number of indices into the translate functions.
primitive restart is support for quads, quad strips
and polygons.
This deal with the case where the actual number of output
primitives is less than the initially calculated number,
by filling the rest of the output primitives with the restart
index, the other option is to reduce the output prim number,
but that will make the generator code a bit messier.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/indices/u_indices.h')
-rw-r--r-- | src/gallium/auxiliary/indices/u_indices.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/indices/u_indices.h b/src/gallium/auxiliary/indices/u_indices.h index 54cd9441abc..e01201e4b04 100644 --- a/src/gallium/auxiliary/indices/u_indices.h +++ b/src/gallium/auxiliary/indices/u_indices.h @@ -31,6 +31,10 @@ #define PV_LAST 1 #define PV_COUNT 2 +/* primitive restart disable/enable flags */ +#define PR_DISABLE 0 +#define PR_ENABLE 1 +#define PR_COUNT 2 /** * Index translator function (for glDrawElements() case) * @@ -42,7 +46,9 @@ */ typedef void (*u_translate_func)( const void *in, unsigned start, - unsigned nr, + unsigned in_nr, + unsigned out_nr, + unsigned restart_index, void *out ); /** @@ -77,6 +83,7 @@ int u_index_translator( unsigned hw_mask, unsigned nr, unsigned in_pv, /* API */ unsigned out_pv, /* hardware */ + unsigned prim_restart, unsigned *out_prim, unsigned *out_index_size, unsigned *out_nr, |