Jordan Justen <[email protected]> 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.
pgpya419bEwpw.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
