summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_shader.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-05-02 17:46:12 +0200
committerNicolai Hähnle <[email protected]>2017-05-12 10:46:06 +0200
commita16ae77185813522d9b82372e18e2727eb2794b6 (patch)
treefac62dd583734629d0204f754235384541537311 /src/gallium/drivers/radeonsi/si_shader.c
parent0dd8aa44b3d08e33574bbc528188d9bb4ea8f7d3 (diff)
radeonsi: get rid of secondary input/output word
By keeping track of fewer generics, everything can fit into 64 bits. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index c12c8ea39e7..837cc1cfb7d 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -148,29 +148,22 @@ unsigned si_shader_io_get_unique_index(unsigned semantic_name, unsigned index)
assert(!"invalid generic index");
return 0;
- default:
- assert(!"invalid semantic name");
- return 0;
- }
-}
-
-unsigned si_shader_io_get_unique_index2(unsigned name, unsigned index)
-{
- switch (name) {
case TGSI_SEMANTIC_FOG:
- return 0;
+ return SI_MAX_IO_GENERIC + 4;
case TGSI_SEMANTIC_LAYER:
- return 1;
+ return SI_MAX_IO_GENERIC + 5;
case TGSI_SEMANTIC_VIEWPORT_INDEX:
- return 2;
+ return SI_MAX_IO_GENERIC + 6;
case TGSI_SEMANTIC_PRIMID:
- return 3;
+ return SI_MAX_IO_GENERIC + 7;
case TGSI_SEMANTIC_COLOR: /* these alias */
case TGSI_SEMANTIC_BCOLOR:
- return 4 + index;
+ assert(index < 2);
+ return SI_MAX_IO_GENERIC + 8 + index;
case TGSI_SEMANTIC_TEXCOORD:
assert(index < 8);
- return 6 + index;
+ assert(SI_MAX_IO_GENERIC + 10 + index < 64);
+ return SI_MAX_IO_GENERIC + 10 + index;
default:
assert(!"invalid semantic name");
return 0;
@@ -2298,16 +2291,10 @@ static void si_llvm_export_vs(struct lp_build_tgsi_context *bld_base,
if (semantic_index >= SI_MAX_IO_GENERIC)
break;
/* fall through */
- case TGSI_SEMANTIC_CLIPDIST:
+ default:
if (shader->key.opt.hw_vs.kill_outputs &
(1ull << si_shader_io_get_unique_index(semantic_name, semantic_index)))
export_param = false;
- break;
- default:
- if (shader->key.opt.hw_vs.kill_outputs2 &
- (1u << si_shader_io_get_unique_index2(semantic_name, semantic_index)))
- export_param = false;
- break;
}
if (outputs[i].vertex_stream[0] != 0 &&
@@ -7159,7 +7146,6 @@ static void si_dump_shader_key(unsigned processor, const struct si_shader *shade
processor == PIPE_SHADER_VERTEX) &&
!key->as_es && !key->as_ls) {
fprintf(f, " opt.hw_vs.kill_outputs = 0x%"PRIx64"\n", key->opt.hw_vs.kill_outputs);
- fprintf(f, " opt.hw_vs.kill_outputs2 = 0x%x\n", key->opt.hw_vs.kill_outputs2);
fprintf(f, " opt.hw_vs.clip_disable = %u\n", key->opt.hw_vs.clip_disable);
}
}