Skip to content

vrend: make sure color read from a buffer is always unclamped

Italo Nicola requested to merge italove/virglrenderer:alt-fix-clamp-color into master

Tipically mesa handles CLAMP_READ_COLOR in gallium frontend, and the default value for CLAMP_READ_COLOR as defined by the GL spec is GL_FIXED_ONLY.

As CLAMP_READ_COLOR is really only used for reading pixel color values from a buffer, there's no problem always returning unclamped colors and letting the guest mesa clamp it if it wants.

If on the other hand, we clamp it on the host, as we do now, then the guest mesa only has clamped values to work with, which needless to say, can't be "unclamped".

Fixes piglit's fbo-blending-snorm tests on the GL backend, but with GL ES it's still broken.

Edited by Italo Nicola

Merge request reports