114
115
free(length_tmp);
119
_mesa_glthread_ProgramChanged(struct gl_context *ctx)
121
struct glthread_state *glthread = &ctx->GLThread;
123
/* Track the last change. */
124
p_atomic_set(&glthread->LastProgramChangeBatch, glthread->next);
125
_mesa_glthread_flush_batch(ctx);
129
_mesa_unmarshal_GetActiveUniform(struct gl_context *ctx,
130
const struct marshal_cmd_GetActiveUniform *cmd)
132
unreachable("never executed");
136
_mesa_marshal_GetActiveUniform(GLuint program, GLuint index, GLsizei bufSize,
137
GLsizei *length, GLint *size, GLenum *type,
140
GET_CURRENT_CONTEXT(ctx);
142
/* Wait for the last glLinkProgram call. */
143
int batch = p_atomic_read(&ctx->GLThread.LastProgramChangeBatch);
145
util_queue_fence_wait(&ctx->GLThread.batches[batch].fence);
146
assert(p_atomic_read(&ctx->GLThread.LastProgramChangeBatch) == -1);
149
/* We can execute glGetActiveUniform without syncing if we are sync'd to
150
* the last calls of glLinkProgram and glDeleteProgram because shader
151
* object IDs and their contents are immutable after those calls and
152
* also thread-safe because they are shared between contexts.
153
* glCreateShaderProgram calls glLinkProgram internally and it always
154
* syncs, so it doesn't need any handling.
156
_mesa_GetActiveUniform_impl(program, index, bufSize, length, size, type,