projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mesa: Refuse to bind a mutable texture object to an image unit in GLES.
[mesa.git]
/
src
/
mesa
/
main
/
objectlabel.c
diff --git
a/src/mesa/main/objectlabel.c
b/src/mesa/main/objectlabel.c
index bfe9ba20b34aeff0e3d7068d2596d10386ebe8c5..1019f893ba8e130fa7c668cb47e83a9d4b274ff0 100644
(file)
--- a/
src/mesa/main/objectlabel.c
+++ b/
src/mesa/main/objectlabel.c
@@
-30,6
+30,7
@@
#include "enums.h"
#include "fbobject.h"
#include "objectlabel.h"
#include "enums.h"
#include "fbobject.h"
#include "objectlabel.h"
+#include "pipelineobj.h"
#include "queryobj.h"
#include "samplerobj.h"
#include "shaderobj.h"
#include "queryobj.h"
#include "samplerobj.h"
#include "shaderobj.h"
@@
-45,11
+46,8
@@
static void
set_label(struct gl_context *ctx, char **labelPtr, const char *label,
int length, const char *caller)
{
set_label(struct gl_context *ctx, char **labelPtr, const char *label,
int length, const char *caller)
{
- if (*labelPtr) {
- /* free old label string */
- free(*labelPtr);
- *labelPtr = NULL;
- }
+ free(*labelPtr);
+ *labelPtr = NULL;
/* set new label string */
if (label) {
/* set new label string */
if (label) {
@@
-61,7
+59,7
@@
set_label(struct gl_context *ctx, char **labelPtr, const char *label,
MAX_LABEL_LENGTH);
/* explicit length */
MAX_LABEL_LENGTH);
/* explicit length */
- *labelPtr =
(char *)
malloc(length+1);
+ *labelPtr = malloc(length+1);
if (*labelPtr) {
memcpy(*labelPtr, label, length);
/* length is not required to include the null terminator so
if (*labelPtr) {
memcpy(*labelPtr, label, length);
/* length is not required to include the null terminator so
@@
-79,7
+77,7
@@
set_label(struct gl_context *ctx, char **labelPtr, const char *label,
MAX_LABEL_LENGTH);
/* null-terminated string */
MAX_LABEL_LENGTH);
/* null-terminated string */
- *labelPtr =
_mesa_
strdup(label);
+ *labelPtr = strdup(label);
}
}
}
}
}
}
@@
-158,7
+156,7
@@
get_label_pointer(struct gl_context *ctx, GLenum identifier, GLuint name,
break;
case GL_VERTEX_ARRAY:
{
break;
case GL_VERTEX_ARRAY:
{
- struct gl_
array_object *obj = _mesa_lookup_arrayobj
(ctx, name);
+ struct gl_
vertex_array_object *obj = _mesa_lookup_vao
(ctx, name);
if (obj)
labelPtr = &obj->Label;
}
if (obj)
labelPtr = &obj->Label;
}
@@
-217,8
+215,13
@@
get_label_pointer(struct gl_context *ctx, GLenum identifier, GLuint name,
}
break;
case GL_PROGRAM_PIPELINE:
}
break;
case GL_PROGRAM_PIPELINE:
- /* requires GL 4.2 */
- goto invalid_enum;
+ {
+ struct gl_pipeline_object *pipe =
+ _mesa_lookup_pipeline_object(ctx, name);
+ if (pipe)
+ labelPtr = &pipe->Label;
+ }
+ break;
default:
goto invalid_enum;
}
default:
goto invalid_enum;
}
@@
-231,7
+234,7
@@
get_label_pointer(struct gl_context *ctx, GLenum identifier, GLuint name,
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(identifier = %s)",
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(identifier = %s)",
- caller, _mesa_
lookup_enum_by_nr
(identifier));
+ caller, _mesa_
enum_to_string
(identifier));
return NULL;
}
return NULL;
}
@@
-256,6
+259,12
@@
_mesa_GetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize,
GET_CURRENT_CONTEXT(ctx);
char **labelPtr;
GET_CURRENT_CONTEXT(ctx);
char **labelPtr;
+ if (bufSize < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectLabel(bufSize = %d)",
+ bufSize);
+ return;
+ }
+
labelPtr = get_label_pointer(ctx, identifier, name, "glGetObjectLabel");
if (!labelPtr)
return;
labelPtr = get_label_pointer(ctx, identifier, name, "glGetObjectLabel");
if (!labelPtr)
return;
@@
-288,6
+297,12
@@
_mesa_GetObjectPtrLabel(const void *ptr, GLsizei bufSize, GLsizei *length,
char **labelPtr;
struct gl_sync_object *const syncObj = (struct gl_sync_object *) ptr;
char **labelPtr;
struct gl_sync_object *const syncObj = (struct gl_sync_object *) ptr;
+ if (bufSize < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectPtrLabel(bufSize = %d)",
+ bufSize);
+ return;
+ }
+
if (!_mesa_validate_sync(ctx, syncObj)) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectPtrLabel (not a valid sync object)");
return;
if (!_mesa_validate_sync(ctx, syncObj)) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectPtrLabel (not a valid sync object)");
return;