We need to map the TGSI semantics to each other using the hw semantic ids.
this fixes glsl-kwin-blur and glsl-routing.
radeon_state_init(state, rscreen->rw, R600_STATE_SHADER, 0, R600_SHADER_PS);
for (i = 0; i < rshader->ninput; i++) {
- tmp = S_028644_SEMANTIC(i);
+ tmp = S_028644_SEMANTIC(r600_find_vs_semantic_index(rctx, rshader, i));
tmp |= S_028644_SEL_CENTROID(1);
if (rshader->input[i].name == TGSI_SEMANTIC_POSITION)
have_pos = TRUE;
const struct tgsi_token *tokens);
extern int r600_pipe_shader_update(struct pipe_context *ctx,
struct r600_context_state *rstate);
+extern int r600_find_vs_semantic_index(struct r600_context *rctx, struct r600_shader *rshader, int id);
#define R600_ERR(fmt, args...) \
fprintf(stderr, "EE %s/%s:%d - "fmt, __FILE__, __func__, __LINE__, ##args)
radeon_state_init(state, rscreen->rw, R600_STATE_SHADER, 0, R600_SHADER_PS);
for (i = 0; i < rshader->ninput; i++) {
- tmp = S_028644_SEMANTIC(i) | S_028644_SEL_CENTROID(1);
+ tmp = S_028644_SEMANTIC(r600_find_vs_semantic_index(rctx, rshader, i)) | S_028644_SEL_CENTROID(1);
if (rshader->input[i].name == TGSI_SEMANTIC_POSITION)
have_pos = TRUE;
if (rshader->input[i].name == TGSI_SEMANTIC_COLOR ||
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);