[Mesa-dev] [PATCH] radeon/r200: Fix FBO formats

Alex Deucher alexdeucher at gmail.com
Tue Jan 15 10:15:57 PST 2013


On Fri, Jan 11, 2013 at 6:37 AM, smoki <smoki00790 at gmail.com> wrote:
> Piglit passes more fbo tests on rv280, 14/28 before and now 28/33.
> Also should fix bug:
> https://bugs.freedesktop.org/show_bug.cgi?id=27704

Does this regress anything in piglit?  It's been a while since I
looked at this code, I think the issue may be that r1xx/r2xx asics
only support ARGB render buffers while the texture hardware supports
both ARGB and RGBA formats so you may run into cases where you can
texture from a buffer, but can't render to it, at least not without an
intermediate blit to convert the format first.

Alex

> ---
>  src/mesa/drivers/dri/radeon/radeon_texture.c |   22 ----------------------
>  1 file changed, 22 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
> index 4835147..78226ef 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_texture.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
> @@ -283,29 +283,7 @@ static gl_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
>                                            GLenum srcFormat,
>                                            GLenum srcType, GLboolean fbo)
>  {
> -#if defined(RADEON_R100)
> -       /* r100 can only do this */
>         return _radeon_texformat_argb8888;
> -#elif defined(RADEON_R200)
> -       const GLuint ui = 1;
> -       const GLubyte littleEndian = *((const GLubyte *)&ui);
> -
> -       if (fbo)
> -               return _radeon_texformat_argb8888;
> -
> -       if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
> -           (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
> -           (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
> -           (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) {
> -               return MESA_FORMAT_RGBA8888;
> -       } else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
> -                  (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
> -                  (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
> -                  (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) {
> -               return MESA_FORMAT_RGBA8888_REV;
> -       } else
> -               return _radeon_texformat_argb8888;
> -#endif
>  }
>
>  gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
> --
> 1.7.10.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list