diff options
author | Dave Airlie <[email protected]> | 2010-09-24 14:58:15 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2010-09-24 14:59:19 +1000 |
commit | 59276b8541049a2d07d32fbb139fb14e21e387fc (patch) | |
tree | 26c9ac7a609d6073f68070dbaede7389c580a711 /src/gallium/drivers/r600/r600_shader.c | |
parent | e74d26d82ab6e4b21c6220d8f599f69ab2acf01e (diff) |
r600g: fixup VP->FP output->input routing.
We need to map the TGSI semantics to each other using the hw semantic ids.
this fixes glsl-kwin-blur and glsl-routing.
Diffstat (limited to 'src/gallium/drivers/r600/r600_shader.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index e18c6ce6052..3274f3be71a 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -64,6 +64,22 @@ struct r600_shader_tgsi_instruction { static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[], eg_shader_tgsi_instruction[]; static int tgsi_helper_tempx_replicate(struct r600_shader_ctx *ctx); +/* called from hw states files to find VS->FS mapping */ +int r600_find_vs_semantic_index(struct r600_context *rctx, struct r600_shader *rshader, int id) +{ + int i; + struct r600_shader *vs = &rctx->vs_shader->shader; + struct r600_shader_io *input = &rshader->input[id]; + + for (i = 0; i < vs->noutput; i++) { + if (input->name == vs->output[i].name && + input->sid == vs->output[i].sid) { + return i - 1; + } + } + return 0; +} + static int r600_shader_update(struct pipe_context *ctx, struct r600_shader *shader) { struct r600_context *rctx = r600_context(ctx); |