X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Firis%2Firis_pipe.h;h=b859e650ffbe374514ab87ab9e09f0750e09dbda;hb=9c597514d42716e2948b6cacbd3a6c95eec2e124;hp=1cb0a76af9ad782fce9a1195c978a8e533b57d16;hpb=6fbb6ba290bed57481a78b9e55de1da1d1d392af;p=mesa.git diff --git a/src/gallium/drivers/iris/iris_pipe.h b/src/gallium/drivers/iris/iris_pipe.h index 1cb0a76af9a..b859e650ffb 100644 --- a/src/gallium/drivers/iris/iris_pipe.h +++ b/src/gallium/drivers/iris/iris_pipe.h @@ -26,7 +26,7 @@ #include "pipe/p_defines.h" #include "compiler/shader_enums.h" -static gl_shader_stage +static inline gl_shader_stage stage_from_pipe(enum pipe_shader_type pstage) { static const gl_shader_stage stages[PIPE_SHADER_TYPES] = { @@ -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