diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/spirv_extensions.c | 22 | ||||
-rw-r--r-- | src/mesa/main/spirv_extensions.h | 15 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/mesa/main/spirv_extensions.c b/src/mesa/main/spirv_extensions.c index 40a89c133aa..7598510e21c 100644 --- a/src/mesa/main/spirv_extensions.c +++ b/src/mesa/main/spirv_extensions.c @@ -40,3 +40,25 @@ _mesa_get_enabled_spirv_extension(struct gl_context *ctx, { return (const GLubyte *) 0; } + +const char * +_mesa_spirv_extensions_to_string(enum SpvExtension ext) +{ +#define STR(x) case x: return #x; + switch (ext) { + STR(SPV_KHR_16bit_storage); + STR(SPV_KHR_device_group); + STR(SPV_KHR_multiview); + STR(SPV_KHR_shader_ballot); + STR(SPV_KHR_shader_draw_parameters); + STR(SPV_KHR_storage_buffer_storage_class); + STR(SPV_KHR_subgroup_vote); + STR(SPV_KHR_variable_pointers); + STR(SPV_AMD_gcn_shader); + case SPV_EXTENSIONS_COUNT: + unreachable("Unknown SPIR-V extension"); + } +#undef STR + + return "unknown"; +} diff --git a/src/mesa/main/spirv_extensions.h b/src/mesa/main/spirv_extensions.h index 35754f7e53b..6c8b8275945 100644 --- a/src/mesa/main/spirv_extensions.h +++ b/src/mesa/main/spirv_extensions.h @@ -35,6 +35,19 @@ extern "C" { #endif +enum SpvExtension { + SPV_KHR_16bit_storage = 0, + SPV_KHR_device_group, + SPV_KHR_multiview, + SPV_KHR_shader_ballot, + SPV_KHR_shader_draw_parameters, + SPV_KHR_storage_buffer_storage_class, + SPV_KHR_subgroup_vote, + SPV_KHR_variable_pointers, + SPV_AMD_gcn_shader, + SPV_EXTENSIONS_COUNT +}; + extern GLuint _mesa_get_spirv_extension_count(struct gl_context *ctx); @@ -42,6 +55,8 @@ extern const GLubyte * _mesa_get_enabled_spirv_extension(struct gl_context *ctx, GLuint index); +const char *_mesa_spirv_extensions_to_string(enum SpvExtension ext); + #ifdef __cplusplus } #endif |