aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_program.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-10-01 23:12:13 +0200
committermarha <marha@users.sourceforge.net>2014-10-01 23:12:13 +0200
commit88236adfe3eb41b8368b4c9ecf3e09a7199dc474 (patch)
tree6acb3f7ad3c60c4605551245df9c321b5fb22c3b /mesalib/src/mesa/state_tracker/st_program.h
parente4086b3defb6186a2fb8a5845968c97e613fb493 (diff)
parent30eb28e89e513ba7c04e8424be0cba326a01882b (diff)
downloadvcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.tar.gz
vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.tar.bz2
vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/win.h xorg-server/hw/xwin/winclipboard/internal.h xorg-server/hw/xwin/winclipboard/thread.c xorg-server/hw/xwin/winclipboard/wndproc.c xorg-server/hw/xwin/winclipboard/xevents.c xorg-server/hw/xwin/winclipboardinit.c xorg-server/hw/xwin/winclipboardwrappers.c xorg-server/hw/xwin/winglobals.c
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_program.h')
-rw-r--r--mesalib/src/mesa/state_tracker/st_program.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_program.h b/mesalib/src/mesa/state_tracker/st_program.h
index 9a5b6a847..cf1b40a55 100644
--- a/mesalib/src/mesa/state_tracker/st_program.h
+++ b/mesalib/src/mesa/state_tracker/st_program.h
@@ -270,6 +270,31 @@ st_reference_fragprog(struct st_context *st,
(struct gl_program *) prog);
}
+/**
+ * This defines mapping from Mesa VARYING_SLOTs to TGSI GENERIC slots.
+ */
+static INLINE unsigned
+st_get_generic_varying_index(struct st_context *st, GLuint attr)
+{
+ if (attr >= VARYING_SLOT_VAR0) {
+ if (st->needs_texcoord_semantic)
+ return attr - VARYING_SLOT_VAR0;
+ else
+ return 9 + (attr - VARYING_SLOT_VAR0);
+ }
+ if (attr == VARYING_SLOT_PNTC) {
+ assert(!st->needs_texcoord_semantic);
+ return 8;
+ }
+ if (attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7) {
+ assert(!st->needs_texcoord_semantic);
+ return attr - VARYING_SLOT_TEX0;
+ }
+
+ assert(0);
+ return 0;
+}
+
extern struct st_vp_variant *
st_get_vp_variant(struct st_context *st,