OSDN Git Service

i965: Fix is-renderable check in intel_image_target_renderbuffer_storage
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 15 Oct 2015 19:50:12 +0000 (12:50 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 5 Nov 2015 14:05:19 +0000 (14:05 +0000)
commitd8c58ff25a3a340990d7d1f69e4cb436ae2bab17
treecda9053ea9de65d7e6ad84351a86b038cad78f6d
parentf86028cf07db1c157a1e8457cc91ad07a1dc3e98
i965: Fix is-renderable check in intel_image_target_renderbuffer_storage

Previously we could create a renderbuffer with format
MESA_FORMAT_R8G8B8A8_UNORM, convert that renderbuffer to an EGLImage,
then FAIL to convert the EGLImage back to a renderbuffer because
reasons.  Just use the same check in
intel_image_target_renderbuffer_storage that brw_render_target_supported
uses.

There are more checks in brw_render_target_supported, but I don't think
they are necessary here.  A different approach would be to refactor
brw_render_target_supported to take rb->Format and rb->NumSamples as
parameters (instead of a gl_renderbuffer) and use the new function here.

Fixes:

    ES2-CTS.gtf.GL2ExtensionTests.egl_image.egl_image

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92476
Cc: "10.3 10.4 10.5 10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7070c8879adff2a1204d7473f119d8194eff919b)
src/mesa/drivers/dri/i965/intel_fbo.c