diff options
author | Michal Krol <[email protected]> | 2010-01-15 14:05:04 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2010-01-15 19:00:06 +0100 |
commit | 42d55953b19db8916a677abc606b8d0a923efb5d (patch) | |
tree | 13c82a4ab6ca4c1b497f30ac9de16cd4bc8dd8b7 /src/gallium/auxiliary/tgsi/tgsi_ureg.c | |
parent | 181adca5d6f03390dcfed567be6dfd9e14eb94a7 (diff) |
tgsi: Add ureg_property_gs_input_prim().
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_ureg.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index ae67c322bbe..8bd6f68dcc0 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -40,6 +40,8 @@ union tgsi_any_token { struct tgsi_header header; struct tgsi_processor processor; struct tgsi_token token; + struct tgsi_property prop; + struct tgsi_property_data prop_data; struct tgsi_declaration decl; struct tgsi_declaration_range decl_range; struct tgsi_declaration_semantic decl_semantic; @@ -131,6 +133,8 @@ struct ureg_program } constant_range[UREG_MAX_CONSTANT_RANGE]; unsigned nr_constant_ranges; + unsigned property_gs_input_prim; + unsigned nr_addrs; unsigned nr_preds; unsigned nr_loops; @@ -256,6 +260,14 @@ ureg_src_register( unsigned file, +void +ureg_property_gs_input_prim(struct ureg_program *ureg, + unsigned gs_input_prim) +{ + ureg->property_gs_input_prim = gs_input_prim; +} + + struct ureg_src ureg_DECL_fs_input( struct ureg_program *ureg, @@ -1064,13 +1076,34 @@ emit_immediate( struct ureg_program *ureg, out[4].imm_data.Uint = v[3]; } +static void +emit_property(struct ureg_program *ureg, + unsigned name, + unsigned data) +{ + union tgsi_any_token *out = get_tokens(ureg, DOMAIN_DECL, 2); + + out[0].value = 0; + out[0].prop.Type = TGSI_TOKEN_TYPE_PROPERTY; + out[0].prop.NrTokens = 2; + out[0].prop.PropertyName = name; + out[1].prop_data.Data = data; +} static void emit_decls( struct ureg_program *ureg ) { unsigned i; + if (ureg->property_gs_input_prim != ~0) { + assert(ureg->processor == TGSI_PROCESSOR_GEOMETRY); + + emit_property(ureg, + TGSI_PROPERTY_GS_INPUT_PRIM, + ureg->property_gs_input_prim); + } + if (ureg->processor == TGSI_PROCESSOR_VERTEX) { for (i = 0; i < UREG_MAX_INPUT; i++) { if (ureg->vs_inputs[i/32] & (1 << (i%32))) { @@ -1280,6 +1313,7 @@ struct ureg_program *ureg_create( unsigned processor ) return NULL; ureg->processor = processor; + ureg->property_gs_input_prim = ~0; return ureg; } |