/* 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;
}
check_begin_texture_render(ctx, newDrawFb);
_mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb);
+ _mesa_update_allow_draw_out_of_order(ctx);
}
if ((bindDrawBuf || bindReadBuf) && ctx->Driver.BindFramebuffer) {
/* 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)");
GL_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT);
bool has_both = false;
for (int j = 0; j < numAttachments; j++) {
- if (attachments[j] == other_format)
+ if (attachments[j] == other_format) {
has_both = true;
- break;
+ break;
+ }
}
if (fb->Attachment[BUFFER_DEPTH].Renderbuffer !=
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)