compiler: Add mesa_scope_name() function

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23328>
This commit is contained in:
Caio Oliveira
2023-06-07 10:48:39 -07:00
committed by Marge Bot
parent 59cc77f0fa
commit 45bd6cfe28
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -444,3 +444,18 @@ num_mesh_vertices_per_primitive(unsigned prim)
unreachable("invalid mesh shader primitive type");
}
}
const char *
mesa_scope_name(mesa_scope scope)
{
static const char *names[] = {
ENUM(SCOPE_NONE),
ENUM(SCOPE_INVOCATION),
ENUM(SCOPE_SUBGROUP),
ENUM(SCOPE_SHADER_CALL),
ENUM(SCOPE_WORKGROUP),
ENUM(SCOPE_QUEUE_FAMILY),
ENUM(SCOPE_DEVICE),
};
return NAME(scope);
}
+2
View File
@@ -1387,6 +1387,8 @@ typedef enum {
SCOPE_DEVICE,
} mesa_scope;
const char *mesa_scope_name(mesa_scope scope);
#ifdef __cplusplus
} /* extern "C" */
#endif