/* Name exists but buffer is not initialized */
if (fb == &DummyFramebuffer) {
fb = ctx->Driver.NewFramebuffer(ctx, id);
- _mesa_HashLockMutex(ctx->Shared->FrameBuffers);
_mesa_HashInsert(ctx->Shared->FrameBuffers, id, fb);
- _mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
}
/* Name doesn't exist */
else if (!fb) {
- _mesa_HashLockMutex(ctx->Shared->FrameBuffers);
fb = ctx->Driver.NewFramebuffer(ctx, id);
if (!fb) {
- _mesa_HashUnlockMutex(ctx->Shared->FrameBuffers);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
return NULL;
}
- _mesa_HashInsertLocked(ctx->Shared->BufferObjects, id, fb);
- _mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
+ _mesa_HashInsert(ctx->Shared->FrameBuffers, id, fb);
}
return fb;
}
|| (i > 0 && ctx->API == API_OPENGLES)) {
return NULL;
}
+ assert(BUFFER_COLOR0 + i < ARRAY_SIZE(fb->Attachment));
return &fb->Attachment[BUFFER_COLOR0 + i];
case GL_DEPTH_STENCIL_ATTACHMENT:
if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
/* Then, make sure it's initialized */
if (fb == &DummyFramebuffer) {
fb = ctx->Driver.NewFramebuffer(ctx, framebuffer);
- _mesa_HashLockMutex(ctx->Shared->FrameBuffers);
_mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, fb);
- _mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
}
}
else
*param = fb->ColorReadBuffer;
}
else if (GL_DRAW_BUFFER0 <= pname && pname <= GL_DRAW_BUFFER15) {
- *param = fb->ColorDrawBuffer[pname - GL_DRAW_BUFFER0];
+ unsigned buffer = pname - GL_DRAW_BUFFER0;
+ if (buffer < ARRAY_SIZE(fb->ColorDrawBuffer))
+ *param = fb->ColorDrawBuffer[buffer];
+ else
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFramebufferParameterivEXT(pname)");
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetFramebufferParameterivEXT(pname)");
const unsigned i = attachment - GL_COLOR_ATTACHMENT0;
if (i >= ctx->Const.MaxColorAttachments)
return NULL;
+ assert(BUFFER_COLOR0 + i < ARRAY_SIZE(fb->Attachment));
return &fb->Attachment[BUFFER_COLOR0 + i];
}
case GL_DEPTH:
if (isnan(v[i]))
fb->SampleLocationTable[start * 2 + i] = 0.5f;
else
- fb->SampleLocationTable[start * 2 + i] = CLAMP(v[i], 0.0f, 1.0f);
+ fb->SampleLocationTable[start * 2 + i] = SATURATE(v[i]);
}
if (fb == ctx->DrawBuffer)