diff options
author | Jonathan Marek <[email protected]> | 2020-06-14 19:21:45 -0400 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2020-06-15 15:35:13 -0400 |
commit | c1e1b13bfe8233748aa04f67fb69bff7e51bf744 (patch) | |
tree | 73ba75ac34210999dabd86490e9949bcf1935fad | |
parent | 067370fe87d6015e973e2a6646ca83924757bda7 (diff) |
turnip: simplify stage2 helpers
Signed-off-by: Jonathan Marek <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5455>
-rw-r--r-- | src/freedreno/vulkan/tu_pipeline.c | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index 2957eeedfb8..d48545e397c 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -43,60 +43,21 @@ uint32_t tu6_stage2opcode(gl_shader_stage stage) { - switch (stage) { - case MESA_SHADER_VERTEX: - case MESA_SHADER_TESS_CTRL: - case MESA_SHADER_TESS_EVAL: - case MESA_SHADER_GEOMETRY: - return CP_LOAD_STATE6_GEOM; - case MESA_SHADER_FRAGMENT: - case MESA_SHADER_COMPUTE: + if (stage == MESA_SHADER_FRAGMENT || stage == MESA_SHADER_COMPUTE) return CP_LOAD_STATE6_FRAG; - default: - unreachable("bad shader stage"); - } + return CP_LOAD_STATE6_GEOM; } static enum a6xx_state_block tu6_stage2texsb(gl_shader_stage stage) { - switch (stage) { - case MESA_SHADER_VERTEX: - return SB6_VS_TEX; - case MESA_SHADER_TESS_CTRL: - return SB6_HS_TEX; - case MESA_SHADER_TESS_EVAL: - return SB6_DS_TEX; - case MESA_SHADER_GEOMETRY: - return SB6_GS_TEX; - case MESA_SHADER_FRAGMENT: - return SB6_FS_TEX; - case MESA_SHADER_COMPUTE: - return SB6_CS_TEX; - default: - unreachable("bad shader stage"); - } + return SB6_VS_TEX + stage; } enum a6xx_state_block tu6_stage2shadersb(gl_shader_stage stage) { - switch (stage) { - case MESA_SHADER_VERTEX: - return SB6_VS_SHADER; - case MESA_SHADER_TESS_CTRL: - return SB6_HS_SHADER; - case MESA_SHADER_TESS_EVAL: - return SB6_DS_SHADER; - case MESA_SHADER_GEOMETRY: - return SB6_GS_SHADER; - case MESA_SHADER_FRAGMENT: - return SB6_FS_SHADER; - case MESA_SHADER_COMPUTE: - return SB6_CS_SHADER; - default: - unreachable("bad shader stage"); - } + return SB6_VS_SHADER + stage; } /* Emit IB that preloads the descriptors that the shader uses */ |