[Mesa-dev] [PATCH v2 08/18] copyteximage: make sure is_srgb(src) == is_srgb(dst)
Eric Anholt
eric at anholt.net
Sun Jan 13 17:05:01 PST 2013
Jordan Justen <jordan.l.justen at intel.com> writes:
> v2:
> * Remove _EXT on enums
> * Remove compressed forms of sRGB from is_srgb_format
> * Add comment referencing GL Core spec
> rb_internal_format = rb->InternalFormat;
> + if (is_srgb_format(internalFormat) != is_srgb_format(rb_internal_format)) {
> + /* Page 190 (page 211 of the PDF) in section 8.6 of the OpenGL 4.3
> + * Core Profile spec says:
> + *
> + * "An INVALID_OPERATION error is generated under any of the
> + * following conditions:
> + *
> + * ...
> + *
> + * - if the value of FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
> + * for the framebuffer attachment corresponding to the read
> + * buffer is SRGB and internalformat is not one of the sRGB
> + * formats. in table 8.23."
> + */
The spec cite talks about looking at the value of
FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, but your test isn't looking at
that value (GL allows srgb texture internalformats to have FB_A_C_E set
to LINEAR, and when you get into window system framebuffers things get
totally implementation-dependent). I'd replicate the
FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING logic here.
Also, I see a couple of values in _mesa_get_linear_internalformat that
aren't covered in your test of the destination texture's internalformat.
_mesa_get_linear_internalformat(internalformat) == internalformat might
be a reasonable way to go.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130113/e0064d1a/attachment.pgp>
More information about the mesa-dev
mailing list