diff options
author | Marek Olšák <[email protected]> | 2015-05-10 13:10:03 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-06-05 19:44:32 +0200 |
commit | 3b1d15775190945b1a639dd9b2581b4032cd2ac6 (patch) | |
tree | cf03a06717f1ad7b45b8490e65d70d9247b19f85 /src/gallium/auxiliary | |
parent | 918ca4031f670066f054cdebcfe68ad75c963ac6 (diff) |
tgsi/ureg: rename and simplify ureg_DECL_gs_input
There is nothing special about it and it's used for tessellation shaders
too.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.c | 31 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.h | 7 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index ca2589ac996..a8f0867cf2f 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -116,8 +116,8 @@ struct ureg_program unsigned index; unsigned semantic_name; unsigned semantic_index; - } gs_input[UREG_MAX_INPUT]; - unsigned nr_gs_inputs; + } input[UREG_MAX_INPUT]; + unsigned nr_inputs; struct { unsigned index; @@ -308,22 +308,23 @@ ureg_DECL_vs_input( struct ureg_program *ureg, struct ureg_src -ureg_DECL_gs_input(struct ureg_program *ureg, - unsigned index, +ureg_DECL_input(struct ureg_program *ureg, unsigned semantic_name, unsigned semantic_index) { - if (ureg->nr_gs_inputs < UREG_MAX_INPUT) { - ureg->gs_input[ureg->nr_gs_inputs].index = index; - ureg->gs_input[ureg->nr_gs_inputs].semantic_name = semantic_name; - ureg->gs_input[ureg->nr_gs_inputs].semantic_index = semantic_index; - ureg->nr_gs_inputs++; + int i = 0; + + if (ureg->nr_inputs < UREG_MAX_INPUT) { + i = ureg->nr_inputs; + ureg->input[i].index = i; + ureg->input[i].semantic_name = semantic_name; + ureg->input[i].semantic_index = semantic_index; + ureg->nr_inputs++; } else { set_bad(ureg); } - /* XXX: Add suport for true 2D input registers. */ - return ureg_src_register(TGSI_FILE_INPUT, index); + return ureg_src_register(TGSI_FILE_INPUT, i); } @@ -1498,12 +1499,12 @@ static void emit_decls( struct ureg_program *ureg ) ureg->fs_input[i].array_id); } } else { - for (i = 0; i < ureg->nr_gs_inputs; i++) { + for (i = 0; i < ureg->nr_inputs; i++) { emit_decl_semantic(ureg, TGSI_FILE_INPUT, - ureg->gs_input[i].index, - ureg->gs_input[i].semantic_name, - ureg->gs_input[i].semantic_index, + ureg->input[i].index, + ureg->input[i].semantic_name, + ureg->input[i].semantic_index, TGSI_WRITEMASK_XYZW); } } diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h index 37846d5be8d..7ad4c93981c 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -209,10 +209,9 @@ ureg_DECL_vs_input( struct ureg_program *, unsigned index ); struct ureg_src -ureg_DECL_gs_input(struct ureg_program *, - unsigned index, - unsigned semantic_name, - unsigned semantic_index); +ureg_DECL_input(struct ureg_program *, + unsigned semantic_name, + unsigned semantic_index); struct ureg_src ureg_DECL_system_value(struct ureg_program *, |