mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 21:40:20 +01:00
i965: Fix crash in do_blit_readpixels()
Fixes a crash in Khronos CTS packed_pixels tests. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
5388fc157e
commit
d714b20eb4
1 changed files with 7 additions and 0 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "main/bufferobj.h"
|
||||
#include "main/readpix.h"
|
||||
#include "main/state.h"
|
||||
#include "main/glformats.h"
|
||||
|
||||
#include "brw_context.h"
|
||||
#include "intel_screen.h"
|
||||
|
|
@ -89,6 +90,12 @@ do_blit_readpixels(struct gl_context * ctx,
|
|||
struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
|
||||
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
|
||||
|
||||
/* Currently this function only supports reading from color buffers. */
|
||||
if (!_mesa_is_color_format(format))
|
||||
return false;
|
||||
|
||||
assert(irb != NULL);
|
||||
|
||||
if (ctx->_ImageTransferState ||
|
||||
!_mesa_format_matches_format_and_type(irb->mt->format, format, type,
|
||||
false)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue