compiler: add stage_is_graphics() helper

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34872>
This commit is contained in:
Lionel Landwerlin
2025-08-28 23:09:36 +03:00
committed by Marge Bot
parent 50fd669294
commit 7cbabcad36
+17
View File
@@ -73,6 +73,23 @@ typedef enum mesa_shader_stage {
MESA_SHADER_KERNEL = 14,
} mesa_shader_stage;
static inline bool
mesa_shader_stage_is_graphics(mesa_shader_stage stage)
{
switch (stage) {
case MESA_SHADER_VERTEX:
case MESA_SHADER_TESS_CTRL:
case MESA_SHADER_TESS_EVAL:
case MESA_SHADER_GEOMETRY:
case MESA_SHADER_FRAGMENT:
case MESA_SHADER_TASK:
case MESA_SHADER_MESH:
return true;
default:
return false;
}
}
static inline bool
mesa_shader_stage_is_compute(mesa_shader_stage stage)
{