mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 10:20:20 +01:00
spirv_extensions: add spirv_supported_extensions on gl_constants
We can use it to get real values for ARB_spirv_extensions methods. Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com> Signed-off-by: Arcady Goldmints-Orlov <agoldmints@igalia.com> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
parent
f6da2a5508
commit
6ed19dcf80
2 changed files with 21 additions and 1 deletions
|
|
@ -4128,6 +4128,9 @@ struct gl_constants
|
|||
|
||||
/** GL_ARB_gl_spirv */
|
||||
struct spirv_supported_capabilities SpirVCapabilities;
|
||||
|
||||
/** GL_ARB_spirv_extensions */
|
||||
struct spirv_supported_extensions *SpirVExtensions;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,13 +32,30 @@
|
|||
GLuint
|
||||
_mesa_get_spirv_extension_count(struct gl_context *ctx)
|
||||
{
|
||||
return 0;
|
||||
if (ctx->Const.SpirVExtensions == NULL)
|
||||
return 0;
|
||||
|
||||
return ctx->Const.SpirVExtensions->count;
|
||||
}
|
||||
|
||||
const GLubyte *
|
||||
_mesa_get_enabled_spirv_extension(struct gl_context *ctx,
|
||||
GLuint index)
|
||||
{
|
||||
unsigned int n = 0;
|
||||
|
||||
if (ctx->Const.SpirVExtensions == NULL)
|
||||
return (const GLubyte *) 0;
|
||||
|
||||
for (unsigned int i = 0; i < SPV_EXTENSIONS_COUNT; i++) {
|
||||
if (ctx->Const.SpirVExtensions->supported[i]) {
|
||||
if (n == index)
|
||||
return (const GLubyte *) _mesa_spirv_extensions_to_string(i);
|
||||
else
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
return (const GLubyte *) 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue