summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.h
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-05-17 17:44:34 +0200
committerNicolai Hähnle <[email protected]>2017-07-05 12:27:11 +0200
commit497b95fdf641eb5e52de1a6a51d251ee2b3bdb2d (patch)
treef704eeaba07ff65ede142ce9e88f064ba14f21d9 /src/mesa/state_tracker/st_program.h
parentd91f97f91db4a826f7d5909a2a63a028a81188bb (diff)
tgsi,st/mesa: move varying slot to semantic mapping into a helper for VS
We will use this helper in radeonsi's NIR path. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_program.h')
-rw-r--r--src/mesa/state_tracker/st_program.h21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index 3f0cf49f025..8e9f4c5e826 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -38,11 +38,11 @@
#include "main/atifragshader.h"
#include "program/program.h"
#include "pipe/p_state.h"
+#include "tgsi/tgsi_from_mesa.h"
#include "st_context.h"
#include "st_texture.h"
#include "st_glsl_to_tgsi.h"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -358,23 +358,8 @@ st_reference_compprog(struct st_context *st,
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;
+ return tgsi_get_generic_gl_varying_index((gl_varying_slot)attr,
+ st->needs_texcoord_semantic);
}
extern void