From 59276b8541049a2d07d32fbb139fb14e21e387fc Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 24 Sep 2010 14:58:15 +1000 Subject: 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. --- src/gallium/drivers/r600/r600_shader.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gallium/drivers/r600/r600_shader.c') diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index e18c6ce605..3274f3be71 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); -- cgit v1.2.3