summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_context.h')
-rw-r--r--src/mesa/state_tracker/st_context.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index a68f881c81c..48c9b6f0bb9 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -279,6 +279,29 @@ st_fb_orientation(const struct gl_framebuffer *fb)
}
+static inline unsigned
+st_shader_stage_to_ptarget(gl_shader_stage stage)
+{
+ switch (stage) {
+ case MESA_SHADER_VERTEX:
+ return PIPE_SHADER_VERTEX;
+ case MESA_SHADER_FRAGMENT:
+ return PIPE_SHADER_FRAGMENT;
+ case MESA_SHADER_GEOMETRY:
+ return PIPE_SHADER_GEOMETRY;
+ case MESA_SHADER_TESS_CTRL:
+ return PIPE_SHADER_TESS_CTRL;
+ case MESA_SHADER_TESS_EVAL:
+ return PIPE_SHADER_TESS_EVAL;
+ case MESA_SHADER_COMPUTE:
+ return PIPE_SHADER_COMPUTE;
+ }
+
+ assert(!"should not be reached");
+ return PIPE_SHADER_VERTEX;
+}
+
+
/** clear-alloc a struct-sized object, with casting */
#define ST_CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T))