diff options
author | Kenneth Graunke <[email protected]> | 2019-04-16 23:54:37 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-04-23 00:24:08 -0700 |
commit | 72277044e22dc43064340630911123ba3331dd85 (patch) | |
tree | 4b4ab117d490d04520c6c285f0960a23565e4608 | |
parent | b45dff1da80c72521235fbf6d1862c13b0fa54d6 (diff) |
iris: Make a gl_shader_stage -> pipe_shader_stage helper function
This is probably not the best place for it, but I don't feel like moving
the one out of the TGSI translator today, and we already have the other
direction here, so...*shrug*
-rw-r--r-- | src/gallium/drivers/iris/iris_pipe.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_pipe.h b/src/gallium/drivers/iris/iris_pipe.h index dac81009168..b859e650ffb 100644 --- a/src/gallium/drivers/iris/iris_pipe.h +++ b/src/gallium/drivers/iris/iris_pipe.h @@ -40,6 +40,20 @@ stage_from_pipe(enum pipe_shader_type pstage) return stages[pstage]; } +static inline enum pipe_shader_type +stage_to_pipe(gl_shader_stage stage) +{ + static const enum pipe_shader_type pstages[MESA_SHADER_STAGES] = { + [MESA_SHADER_VERTEX] = PIPE_SHADER_VERTEX, + [MESA_SHADER_TESS_CTRL] = PIPE_SHADER_TESS_CTRL, + [MESA_SHADER_TESS_EVAL] = PIPE_SHADER_TESS_EVAL, + [MESA_SHADER_GEOMETRY] = PIPE_SHADER_GEOMETRY, + [MESA_SHADER_FRAGMENT] = PIPE_SHADER_FRAGMENT, + [MESA_SHADER_COMPUTE] = PIPE_SHADER_COMPUTE, + }; + return pstages[stage]; +} + /** * Convert an swizzle enumeration (i.e. PIPE_SWIZZLE_X) to one of the HW's * "Shader Channel Select" enumerations (i.e. SCS_RED). The mappings are |