#include "buffers.h"
#include "context.h"
#include "fbobject.h"
#include "framebuffer.h"
#include "hash.h"
#include "macros.h"
#include "mipmap.h"
#include "renderbuffer.h"
#include "state.h"
#include "teximage.h"
#include "texobj.h"
#include "texstore.h"
Defines | |
| #define | DEBUG_FBO 0 |
| Set this to 1 to help debug FBO incompleteness problems. | |
| #define | IS_CUBE_FACE(TARGET) |
| #define | NO_SAMPLES 1000 |
| sentinal value, see below | |
Functions | |
| static void | delete_dummy_renderbuffer (struct gl_renderbuffer *rb) |
| static void | delete_dummy_framebuffer (struct gl_framebuffer *fb) |
| void | _mesa_init_fbobjects (GLcontext *ctx) |
| struct gl_renderbuffer * | _mesa_lookup_renderbuffer (GLcontext *ctx, GLuint id) |
| Helper routine for getting a gl_renderbuffer. | |
| struct gl_framebuffer * | _mesa_lookup_framebuffer (GLcontext *ctx, GLuint id) |
| Helper routine for getting a gl_framebuffer. | |
| static void | invalidate_framebuffer (struct gl_framebuffer *fb) |
| Mark the given framebuffer as invalid. | |
| struct gl_renderbuffer_attachment * | _mesa_get_attachment (GLcontext *ctx, struct gl_framebuffer *fb, GLenum attachment) |
| Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding gl_renderbuffer_attachment object. | |
| void | _mesa_remove_attachment (GLcontext *ctx, struct gl_renderbuffer_attachment *att) |
| Remove any texture or renderbuffer attached to the given attachment point. | |
| void | _mesa_set_texture_attachment (GLcontext *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer_attachment *att, struct gl_texture_object *texObj, GLenum texTarget, GLuint level, GLuint zoffset) |
| Bind a texture object to an attachment point. | |
| void | _mesa_set_renderbuffer_attachment (GLcontext *ctx, struct gl_renderbuffer_attachment *att, struct gl_renderbuffer *rb) |
| Bind a renderbuffer to an attachment point. | |
| void | _mesa_framebuffer_renderbuffer (GLcontext *ctx, struct gl_framebuffer *fb, GLenum attachment, struct gl_renderbuffer *rb) |
| Fallback for ctx->Driver.FramebufferRenderbuffer() Attach a renderbuffer object to a framebuffer object. | |
| static void | att_incomplete (const char *msg) |
| For debug only. | |
| static void | fbo_incomplete (const char *msg, int index) |
| For debug only. | |
| static void | test_attachment_completeness (const GLcontext *ctx, GLenum format, struct gl_renderbuffer_attachment *att) |
| Test if an attachment point is complete and update its Complete field. | |
| void | _mesa_test_framebuffer_completeness (GLcontext *ctx, struct gl_framebuffer *fb) |
| Test if the given framebuffer object is complete and update its Status field with the results. | |
| GLboolean GLAPIENTRY | _mesa_IsRenderbufferEXT (GLuint renderbuffer) |
| void GLAPIENTRY | _mesa_BindRenderbufferEXT (GLenum target, GLuint renderbuffer) |
| static void | detach_renderbuffer (GLcontext *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer *rb) |
| If the given renderbuffer is anywhere attached to the framebuffer, detach the renderbuffer. | |
| void GLAPIENTRY | _mesa_DeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers) |
| void GLAPIENTRY | _mesa_GenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers) |
| GLenum | _mesa_base_fbo_format (GLcontext *ctx, GLenum internalFormat) |
| Given an internal format token for a render buffer, return the corresponding base format. | |
| static void | renderbuffer_storage (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei samples) |
| Helper function used by _mesa_RenderbufferStorageEXT() and _mesa_RenderbufferStorageMultisample(). | |
| void GLAPIENTRY | _mesa_RenderbufferStorageEXT (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height) |
| void GLAPIENTRY | _mesa_RenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height) |
| void GLAPIENTRY | _mesa_GetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params) |
| GLboolean GLAPIENTRY | _mesa_IsFramebufferEXT (GLuint framebuffer) |
| static void | check_begin_texture_render (GLcontext *ctx, struct gl_framebuffer *fb) |
| static void | check_end_texture_render (GLcontext *ctx, struct gl_framebuffer *fb) |
| Examine all the framebuffer's attachments to see if any are textures. | |
| void GLAPIENTRY | _mesa_BindFramebufferEXT (GLenum target, GLuint framebuffer) |
| void GLAPIENTRY | _mesa_DeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers) |
| void GLAPIENTRY | _mesa_GenFramebuffersEXT (GLsizei n, GLuint *framebuffers) |
| GLenum GLAPIENTRY | _mesa_CheckFramebufferStatusEXT (GLenum target) |
| static void | framebuffer_texture (GLcontext *ctx, const char *caller, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) |
| Common code called by glFramebufferTexture1D/2D/3DEXT(). | |
| void GLAPIENTRY | _mesa_FramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) |
| void GLAPIENTRY | _mesa_FramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) |
| void GLAPIENTRY | _mesa_FramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) |
| void GLAPIENTRY | _mesa_FramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) |
| void GLAPIENTRY | _mesa_FramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbufferTarget, GLuint renderbuffer) |
| void GLAPIENTRY | _mesa_GetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params) |
| void GLAPIENTRY | _mesa_GenerateMipmapEXT (GLenum target) |
Variables | |
| static struct gl_framebuffer | DummyFramebuffer |
| Notes:. | |
| static struct gl_renderbuffer | DummyRenderbuffer |
| #define DEBUG_FBO 0 |
Set this to 1 to help debug FBO incompleteness problems.
| #define IS_CUBE_FACE | ( | TARGET | ) |
Value:
((TARGET) >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && \
(TARGET) <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
| #define NO_SAMPLES 1000 |
sentinal value, see below
| GLenum _mesa_base_fbo_format | ( | GLcontext * | ctx, | |
| GLenum | internalFormat | |||
| ) |
Given an internal format token for a render buffer, return the corresponding base format.
This is very similar to _mesa_base_tex_format() but the set of valid internal formats is somewhat different.
| void GLAPIENTRY _mesa_BindFramebufferEXT | ( | GLenum | target, | |
| GLuint | framebuffer | |||
| ) |
| void GLAPIENTRY _mesa_BindRenderbufferEXT | ( | GLenum | target, | |
| GLuint | renderbuffer | |||
| ) |
| GLenum GLAPIENTRY _mesa_CheckFramebufferStatusEXT | ( | GLenum | target | ) |
| void GLAPIENTRY _mesa_DeleteFramebuffersEXT | ( | GLsizei | n, | |
| const GLuint * | framebuffers | |||
| ) |
| void GLAPIENTRY _mesa_DeleteRenderbuffersEXT | ( | GLsizei | n, | |
| const GLuint * | renderbuffers | |||
| ) |
| void _mesa_framebuffer_renderbuffer | ( | GLcontext * | ctx, | |
| struct gl_framebuffer * | fb, | |||
| GLenum | attachment, | |||
| struct gl_renderbuffer * | rb | |||
| ) |
Fallback for ctx->Driver.FramebufferRenderbuffer() Attach a renderbuffer object to a framebuffer object.
| void GLAPIENTRY _mesa_FramebufferRenderbufferEXT | ( | GLenum | target, | |
| GLenum | attachment, | |||
| GLenum | renderbufferTarget, | |||
| GLuint | renderbuffer | |||
| ) |
| void GLAPIENTRY _mesa_FramebufferTexture1DEXT | ( | GLenum | target, | |
| GLenum | attachment, | |||
| GLenum | textarget, | |||
| GLuint | texture, | |||
| GLint | level | |||
| ) |
| void GLAPIENTRY _mesa_FramebufferTexture2DEXT | ( | GLenum | target, | |
| GLenum | attachment, | |||
| GLenum | textarget, | |||
| GLuint | texture, | |||
| GLint | level | |||
| ) |
| void GLAPIENTRY _mesa_FramebufferTexture3DEXT | ( | GLenum | target, | |
| GLenum | attachment, | |||
| GLenum | textarget, | |||
| GLuint | texture, | |||
| GLint | level, | |||
| GLint | zoffset | |||
| ) |
| void GLAPIENTRY _mesa_FramebufferTextureLayerEXT | ( | GLenum | target, | |
| GLenum | attachment, | |||
| GLuint | texture, | |||
| GLint | level, | |||
| GLint | layer | |||
| ) |
| void GLAPIENTRY _mesa_GenerateMipmapEXT | ( | GLenum | target | ) |
| void GLAPIENTRY _mesa_GenFramebuffersEXT | ( | GLsizei | n, | |
| GLuint * | framebuffers | |||
| ) |
| void GLAPIENTRY _mesa_GenRenderbuffersEXT | ( | GLsizei | n, | |
| GLuint * | renderbuffers | |||
| ) |
| struct gl_renderbuffer_attachment* _mesa_get_attachment | ( | GLcontext * | ctx, | |
| struct gl_framebuffer * | fb, | |||
| GLenum | attachment | |||
| ) | [read] |
Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding gl_renderbuffer_attachment object.
If attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to the depth buffer attachment point.
| void GLAPIENTRY _mesa_GetFramebufferAttachmentParameterivEXT | ( | GLenum | target, | |
| GLenum | attachment, | |||
| GLenum | pname, | |||
| GLint * | params | |||
| ) |
| void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT | ( | GLenum | target, | |
| GLenum | pname, | |||
| GLint * | params | |||
| ) |
| void _mesa_init_fbobjects | ( | GLcontext * | ctx | ) |
| GLboolean GLAPIENTRY _mesa_IsFramebufferEXT | ( | GLuint | framebuffer | ) |
| GLboolean GLAPIENTRY _mesa_IsRenderbufferEXT | ( | GLuint | renderbuffer | ) |
| struct gl_framebuffer* _mesa_lookup_framebuffer | ( | GLcontext * | ctx, | |
| GLuint | id | |||
| ) | [read] |
Helper routine for getting a gl_framebuffer.
| struct gl_renderbuffer* _mesa_lookup_renderbuffer | ( | GLcontext * | ctx, | |
| GLuint | id | |||
| ) | [read] |
Helper routine for getting a gl_renderbuffer.
| void _mesa_remove_attachment | ( | GLcontext * | ctx, | |
| struct gl_renderbuffer_attachment * | att | |||
| ) |
Remove any texture or renderbuffer attached to the given attachment point.
Update reference counts, etc.
| void GLAPIENTRY _mesa_RenderbufferStorageEXT | ( | GLenum | target, | |
| GLenum | internalFormat, | |||
| GLsizei | width, | |||
| GLsizei | height | |||
| ) |
| void GLAPIENTRY _mesa_RenderbufferStorageMultisample | ( | GLenum | target, | |
| GLsizei | samples, | |||
| GLenum | internalFormat, | |||
| GLsizei | width, | |||
| GLsizei | height | |||
| ) |
| void _mesa_set_renderbuffer_attachment | ( | GLcontext * | ctx, | |
| struct gl_renderbuffer_attachment * | att, | |||
| struct gl_renderbuffer * | rb | |||
| ) |
Bind a renderbuffer to an attachment point.
The previous binding, if any, will be removed first.
| void _mesa_set_texture_attachment | ( | GLcontext * | ctx, | |
| struct gl_framebuffer * | fb, | |||
| struct gl_renderbuffer_attachment * | att, | |||
| struct gl_texture_object * | texObj, | |||
| GLenum | texTarget, | |||
| GLuint | level, | |||
| GLuint | zoffset | |||
| ) |
Bind a texture object to an attachment point.
The previous binding, if any, will be removed first.
| void _mesa_test_framebuffer_completeness | ( | GLcontext * | ctx, | |
| struct gl_framebuffer * | fb | |||
| ) |
Test if the given framebuffer object is complete and update its Status field with the results.
Calls the ctx->Driver.ValidateFramebuffer() function to allow the driver to make hardware-specific validation/completeness checks. Also update the framebuffer's Width and Height fields if the framebuffer is complete.
| static void att_incomplete | ( | const char * | msg | ) | [static] |
For debug only.
| static void check_begin_texture_render | ( | GLcontext * | ctx, | |
| struct gl_framebuffer * | fb | |||
| ) | [static] |
| static void check_end_texture_render | ( | GLcontext * | ctx, | |
| struct gl_framebuffer * | fb | |||
| ) | [static] |
Examine all the framebuffer's attachments to see if any are textures.
If so, call ctx->Driver.FinishRenderTexture() for each texture to notify the device driver that the texture image may have changed.
| static void delete_dummy_framebuffer | ( | struct gl_framebuffer * | fb | ) | [static] |
| static void delete_dummy_renderbuffer | ( | struct gl_renderbuffer * | rb | ) | [static] |
| static void detach_renderbuffer | ( | GLcontext * | ctx, | |
| struct gl_framebuffer * | fb, | |||
| struct gl_renderbuffer * | rb | |||
| ) | [static] |
If the given renderbuffer is anywhere attached to the framebuffer, detach the renderbuffer.
This is used when a renderbuffer object is deleted. The spec calls for unbinding.
| static void fbo_incomplete | ( | const char * | msg, | |
| int | index | |||
| ) | [static] |
For debug only.
| static void framebuffer_texture | ( | GLcontext * | ctx, | |
| const char * | caller, | |||
| GLenum | target, | |||
| GLenum | attachment, | |||
| GLenum | textarget, | |||
| GLuint | texture, | |||
| GLint | level, | |||
| GLint | zoffset | |||
| ) | [static] |
Common code called by glFramebufferTexture1D/2D/3DEXT().
| static void invalidate_framebuffer | ( | struct gl_framebuffer * | fb | ) | [static] |
Mark the given framebuffer as invalid.
This will force the test for framebuffer completeness to be done before the framebuffer is used.
| static void renderbuffer_storage | ( | GLenum | target, | |
| GLenum | internalFormat, | |||
| GLsizei | width, | |||
| GLsizei | height, | |||
| GLsizei | samples | |||
| ) | [static] |
Helper function used by _mesa_RenderbufferStorageEXT() and _mesa_RenderbufferStorageMultisample().
samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT().
| static void test_attachment_completeness | ( | const GLcontext * | ctx, | |
| GLenum | format, | |||
| struct gl_renderbuffer_attachment * | att | |||
| ) | [static] |
Test if an attachment point is complete and update its Complete field.
| format | if GL_COLOR, this is a color attachment point, if GL_DEPTH, this is a depth component attachment point, if GL_STENCIL, this is a stencil component attachment point. |
struct gl_framebuffer DummyFramebuffer [static] |
Notes:.
None of the GL_EXT_framebuffer_object functions are compiled into display lists.
struct gl_renderbuffer DummyRenderbuffer [static] |
1.5.4