mesa: Fix ReadBuffers with pbuffers
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 28 Jun 2019 19:56:38 +0000 (12:56 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 22 Jul 2019 23:58:09 +0000 (16:58 -0700)
commit78164a3a6c278adcbb93e21b64a575c3f8598327
treed9960ccdb1fffc1e8d150867ab9154a29fca1a99
parentc37df5feaa267080b836bbcf0f2727ec9f1d288e
mesa: Fix ReadBuffers with pbuffers

pbuffers are internally single-buffered.  Marek fixed DrawBuffers to
handle this case, but we need to fix ReadBuffers too.  Otherwise,
pretty much every conformance test fails because glReadPixels breaks.

v2: Refactor the switch into a helper (suggested by Eric Anholt)

Fixes: 35294f2eca8 ("mesa: fix pbuffers because internally they are front buffers")
Acked-by: Eric Engestrom <eric.engestrom@intel.com> (v1)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/buffers.c