* If \p attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to
* the depth buffer attachment point.
*/
-struct gl_renderbuffer_attachment *
-_mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLenum attachment)
+static struct gl_renderbuffer_attachment *
+get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLenum attachment)
{
GLuint i;
* Remove any texture or renderbuffer attached to the given attachment
* point. Update reference counts, etc.
*/
-void
-_mesa_remove_attachment(struct gl_context *ctx,
- struct gl_renderbuffer_attachment *att)
+static void
+remove_attachment(struct gl_context *ctx,
+ struct gl_renderbuffer_attachment *att)
{
struct gl_renderbuffer *rb = att->Renderbuffer;
* Bind a texture object to an attachment point.
* The previous binding, if any, will be removed first.
*/
-void
-_mesa_set_texture_attachment(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att,
- struct gl_texture_object *texObj,
- GLenum texTarget, GLuint level, GLuint zoffset,
- GLboolean layered)
+static void
+set_texture_attachment(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att,
+ struct gl_texture_object *texObj,
+ GLenum texTarget, GLuint level, GLuint zoffset,
+ GLboolean layered)
{
struct gl_renderbuffer *rb = att->Renderbuffer;
}
else {
/* new attachment */
- _mesa_remove_attachment(ctx, att);
+ remove_attachment(ctx, att);
att->Type = GL_TEXTURE;
assert(!att->Texture);
_mesa_reference_texobj(&att->Texture, texObj);
* Bind a renderbuffer to an attachment point.
* The previous binding, if any, will be removed first.
*/
-void
-_mesa_set_renderbuffer_attachment(struct gl_context *ctx,
- struct gl_renderbuffer_attachment *att,
- struct gl_renderbuffer *rb)
+static void
+set_renderbuffer_attachment(struct gl_context *ctx,
+ struct gl_renderbuffer_attachment *att,
+ struct gl_renderbuffer *rb)
{
/* XXX check if re-doing same attachment, exit early */
- _mesa_remove_attachment(ctx, att);
+ remove_attachment(ctx, att);
att->Type = GL_RENDERBUFFER_EXT;
att->Texture = NULL; /* just to be safe */
att->Complete = GL_FALSE;
_glthread_LOCK_MUTEX(fb->Mutex);
- att = _mesa_get_attachment(ctx, fb, attachment);
+ att = get_attachment(ctx, fb, attachment);
ASSERT(att);
if (rb) {
- _mesa_set_renderbuffer_attachment(ctx, att, rb);
+ set_renderbuffer_attachment(ctx, att, rb);
if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
/* do stencil attachment here (depth already done above) */
- att = _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT);
+ att = get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT);
assert(att);
- _mesa_set_renderbuffer_attachment(ctx, att, rb);
+ set_renderbuffer_attachment(ctx, att, rb);
}
rb->AttachedAnytime = GL_TRUE;
}
else {
- _mesa_remove_attachment(ctx, att);
+ remove_attachment(ctx, att);
}
invalidate_framebuffer(fb);
for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) {
if (fb->ColorDrawBuffer[j] != GL_NONE) {
const struct gl_renderbuffer_attachment *att
- = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);
+ = get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);
assert(att);
if (att->Type == GL_NONE) {
fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;
/* Check that the ReadBuffer is present */
if (fb->ColorReadBuffer != GL_NONE) {
const struct gl_renderbuffer_attachment *att
- = _mesa_get_attachment(ctx, fb, fb->ColorReadBuffer);
+ = get_attachment(ctx, fb, fb->ColorReadBuffer);
assert(att);
if (att->Type == GL_NONE) {
fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;
for (i = 0; i < BUFFER_COUNT; i++) {
if (fb->Attachment[i].Texture == att
|| fb->Attachment[i].Renderbuffer == att) {
- _mesa_remove_attachment(ctx, &fb->Attachment[i]);
+ remove_attachment(ctx, &fb->Attachment[i]);
progress = true;
}
}
}
}
- att = _mesa_get_attachment(ctx, fb, attachment);
+ att = get_attachment(ctx, fb, attachment);
if (att == NULL) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glFramebufferTexture%sEXT(attachment)", caller);
reuse_framebuffer_texture_attachment(fb, BUFFER_STENCIL,
BUFFER_DEPTH);
} else {
- _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget,
+ set_texture_attachment(ctx, fb, att, texObj, textarget,
level, zoffset, layered);
if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
/* Above we created a new renderbuffer and attached it to the
texObj->_RenderToTexture = GL_TRUE;
}
else {
- _mesa_remove_attachment(ctx, att);
+ remove_attachment(ctx, att);
if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
assert(att == &fb->Attachment[BUFFER_DEPTH]);
- _mesa_remove_attachment(ctx, &fb->Attachment[BUFFER_STENCIL]);
+ remove_attachment(ctx, &fb->Attachment[BUFFER_STENCIL]);
}
}
return;
}
- att = _mesa_get_attachment(ctx, fb, attachment);
+ att = get_attachment(ctx, fb, attachment);
if (att == NULL) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glFramebufferRenderbufferEXT(invalid attachment %s)",
}
else {
/* user-created framebuffer FBO */
- att = _mesa_get_attachment(ctx, buffer, attachment);
+ att = get_attachment(ctx, buffer, attachment);
}
if (att == NULL) {
if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
/* the depth and stencil attachments must point to the same buffer */
const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt;
- depthAtt = _mesa_get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT);
- stencilAtt = _mesa_get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT);
+ depthAtt = get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT);
+ stencilAtt = get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT);
if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL"