summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2019-08-27 14:24:22 +1000
committerTimothy Arceri <[email protected]>2019-11-20 05:05:55 +0000
commit2497c517176c2c9bd418d7d54eaef9aba0711727 (patch)
treeb97a7b5aaf6828f197f1cef987d27113a2dde154 /src/mesa/main/shaderapi.c
parentf2d01cac7ea3e696c6e61952443920aa14637e7d (diff)
mesa: implement glDeleteNamedStringARB()
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 162015c5b39..efbdda4ddb0 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -3415,6 +3415,31 @@ _mesa_NamedStringARB(GLenum type, GLint namelen, const GLchar *name,
GLvoid GLAPIENTRY
_mesa_DeleteNamedStringARB(GLint namelen, const GLchar *name)
{
+ GET_CURRENT_CONTEXT(ctx);
+ const char *caller = "glDeleteNamedStringARB";
+
+ char *name_cp = copy_string(ctx, name, namelen, caller);
+ if (!name_cp)
+ return;
+
+ struct sh_incl_path_ht_entry *shader_include =
+ lookup_shader_include(ctx, name_cp, true);
+
+ if (!shader_include) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(no string associated with path %s)", caller, name_cp);
+ free(name_cp);
+ return;
+ }
+
+ mtx_lock(&ctx->Shared->ShaderIncludeMutex);
+
+ free(shader_include->shader_source);
+ shader_include->shader_source = NULL;
+
+ mtx_unlock(&ctx->Shared->ShaderIncludeMutex);
+
+ free(name_cp);
}
GLvoid GLAPIENTRY