aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-10-01 20:47:44 +0200
committermarha <marha@users.sourceforge.net>2014-10-01 20:47:44 +0200
commit30eb28e89e513ba7c04e8424be0cba326a01882b (patch)
treec84d1ffa742ebc6f077abb20a6b80c56ddaea888 /mesalib/src/mesa/state_tracker/st_program.c
parent438af0c7d4bf60b408b259c88205ff2193195466 (diff)
downloadvcxsrv-30eb28e89e513ba7c04e8424be0cba326a01882b.tar.gz
vcxsrv-30eb28e89e513ba7c04e8424be0cba326a01882b.tar.bz2
vcxsrv-30eb28e89e513ba7c04e8424be0cba326a01882b.zip
libxtrans pixman fontconfig mesa xserver xkeyboard-config git update 1 Oct 2014
plink 10277 xserver commit d3d845ca9e92f0a2ccde93f4242d7769cfe14164 xkeyboard-config commit 73aa90ce32967747c84a1b5fe32cee329bc3bbcf pixman commit f078727f392bc9f235df916e75634ed87177b9b4 libxtrans commit 7cbad9fe2e61cd9d5caeaf361826a6f4bd320f03 fontconfig commit 1082161ea303cf2bbc13b62a191662984131e820 mesa commit 4f7916ab4f8093fa33519dfa3d08e73b4d35ebe3
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_program.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_program.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c
index fbf8930cb..926086bf8 100644
--- a/mesalib/src/mesa/state_tracker/st_program.c
+++ b/mesalib/src/mesa/state_tracker/st_program.c
@@ -275,17 +275,18 @@ st_prepare_vertex_program(struct gl_context *ctx,
case VARYING_SLOT_TEX5:
case VARYING_SLOT_TEX6:
case VARYING_SLOT_TEX7:
- stvp->output_semantic_name[slot] = st->needs_texcoord_semantic ?
- TGSI_SEMANTIC_TEXCOORD : TGSI_SEMANTIC_GENERIC;
- stvp->output_semantic_index[slot] = attr - VARYING_SLOT_TEX0;
- break;
-
+ if (st->needs_texcoord_semantic) {
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_TEXCOORD;
+ stvp->output_semantic_index[slot] = attr - VARYING_SLOT_TEX0;
+ break;
+ }
+ /* fall through */
case VARYING_SLOT_VAR0:
default:
assert(attr < VARYING_SLOT_MAX);
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- stvp->output_semantic_index[slot] = st->needs_texcoord_semantic ?
- (attr - VARYING_SLOT_VAR0) : (attr - VARYING_SLOT_TEX0);
+ stvp->output_semantic_index[slot] =
+ st_get_generic_varying_index(st, attr);
break;
}
}
@@ -655,9 +656,8 @@ st_translate_fragment_program(struct st_context *st,
* the user varyings on VAR0. Otherwise, we use TEX0 as base index.
*/
assert(attr >= VARYING_SLOT_TEX0);
- input_semantic_index[slot] = st->needs_texcoord_semantic ?
- (attr - VARYING_SLOT_VAR0) : (attr - VARYING_SLOT_TEX0);
input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ input_semantic_index[slot] = st_get_generic_varying_index(st, attr);
if (attr == VARYING_SLOT_PNTC)
interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
else
@@ -974,16 +974,18 @@ st_translate_geometry_program(struct st_context *st,
case VARYING_SLOT_TEX5:
case VARYING_SLOT_TEX6:
case VARYING_SLOT_TEX7:
- stgp->input_semantic_name[slot] = st->needs_texcoord_semantic ?
- TGSI_SEMANTIC_TEXCOORD : TGSI_SEMANTIC_GENERIC;
- stgp->input_semantic_index[slot] = (attr - VARYING_SLOT_TEX0);
- break;
+ if (st->needs_texcoord_semantic) {
+ stgp->input_semantic_name[slot] = TGSI_SEMANTIC_TEXCOORD;
+ stgp->input_semantic_index[slot] = attr - VARYING_SLOT_TEX0;
+ break;
+ }
+ /* fall through */
case VARYING_SLOT_VAR0:
default:
assert(attr >= VARYING_SLOT_VAR0 && attr < VARYING_SLOT_MAX);
stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- stgp->input_semantic_index[slot] = st->needs_texcoord_semantic ?
- (attr - VARYING_SLOT_VAR0) : (attr - VARYING_SLOT_TEX0);
+ stgp->input_semantic_index[slot] =
+ st_get_generic_varying_index(st, attr);
break;
}
}
@@ -1069,17 +1071,19 @@ st_translate_geometry_program(struct st_context *st,
case VARYING_SLOT_TEX5:
case VARYING_SLOT_TEX6:
case VARYING_SLOT_TEX7:
- gs_output_semantic_name[slot] = st->needs_texcoord_semantic ?
- TGSI_SEMANTIC_TEXCOORD : TGSI_SEMANTIC_GENERIC;
- gs_output_semantic_index[slot] = (attr - VARYING_SLOT_TEX0);
- break;
+ if (st->needs_texcoord_semantic) {
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_TEXCOORD;
+ gs_output_semantic_index[slot] = attr - VARYING_SLOT_TEX0;
+ break;
+ }
+ /* fall through */
case VARYING_SLOT_VAR0:
default:
assert(slot < Elements(gs_output_semantic_name));
assert(attr >= VARYING_SLOT_VAR0);
gs_output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- gs_output_semantic_index[slot] = st->needs_texcoord_semantic ?
- (attr - VARYING_SLOT_VAR0) : (attr - VARYING_SLOT_TEX0);
+ gs_output_semantic_index[slot] =
+ st_get_generic_varying_index(st, attr);
break;
}
}