aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-07-23 21:57:19 +0200
committerMarek Olšák <[email protected]>2015-07-29 00:10:27 +0200
commit768b4a25b95b95989dae3ff2f5a06172a2f4ab85 (patch)
tree9d5f2af312d00e76cbdf7bfcfdb7fbfe0890404b /src/mesa/state_tracker/st_context.h
parent82546729e3533c9a5ec0392585a60833bd93acca (diff)
st/mesa: fix GLSL 1.30 texture shadow functions with the GL_ALPHA depth mode (v2)
Fixes piglit: [email protected]@execution@fs-texture-sampler2dshadow-10 [email protected]@execution@fs-texture-sampler2dshadow-11 v2: use st_shader_stage_to_ptarget Reviewed-by: Brian Paul <[email protected]>
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))