[Mesa-dev] [PATCH] mesa: Fix render buffer initial internal format type
Chad Versace
chad.versace at intel.com
Tue Jan 13 10:46:31 PST 2015
On 01/09/2015 05:21 PM, michael.w.mason at intel.com wrote:
> From: Mike Mason <michael.w.mason at intel.com>
>
> Changes the initial internal format of a render buffer
> to GL_RGBA4. This fixes a failure in the following
> DrawElements test:
>
> dEQP-GLES3.functional.state_query.rbo.renderbuffer_internal_format
> ---
> src/mesa/main/renderbuffer.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
> index 0bc7f2b..b339491 100644
> --- a/src/mesa/main/renderbuffer.c
> +++ b/src/mesa/main/renderbuffer.c
> @@ -53,7 +53,11 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name)
> rb->Width = 0;
> rb->Height = 0;
> rb->Depth = 0;
> - rb->InternalFormat = GL_RGBA;
> + /* Default internal format should be GL_RGBA4, per page 258,
> + * table 6.15 of the GLES 3.0.4 spec. Same default is expected
> + * in all OpenGL specs that support BindRenderbuffer().
> + */
> + rb->InternalFormat = GL_RGBA4;
> rb->Format = MESA_FORMAT_NONE;
> }
>
>
The patch needs to choose the initial internalformat based on
the context API. Table 6.26 in the GL 3.3 Core spec says the initial
renderbuffer internalformat is GL_RGBA. Table 6.15 of the GLES 3.0 spec
says GL_RGBA4.
I think this is the correct logic:
if (_mesa_is_desktop_gl(ctx)) {
rb->InternalFormat = GL_RGBA;
} else {
rb->InternalFormat = GL_RGBA4;
}
Please add both spec references in your patch.
~
~
~
~
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150113/6022604a/attachment.sig>
More information about the mesa-dev
mailing list