Commit 9fd0e76a authored by Paul Berry's avatar Paul Berry

i965/blorp: allow all buffer formats provided src and dst match.

Previously, blits using the "blorp" mechanism only worked for 8-bit
RGBA color buffers, 24-bit depth buffers, and 8 bit stencil buffers.
This was not enough, because the blorp mechanism must be used for
blitting whenever MSAA is in use.  This patch allows all formats to be
used, provided the source and destination formats match.

So far I have confirmed that the following formats work properly with
MSAA:
- GL_RGB
- GL_RGBA
- GL_ALPHA
- GL_ALPHA4
- GL_ALPHA8
- GL_R3_G3_B2
- GL_RGB4
- GL_RGB5
- GL_RGB8
- GL_RGB10
- GL_RGB12
- GL_RGB16
- GL_RGBA2
- GL_RGBA4
- GL_RGB5_A1
- GL_RGBA8
- GL_RGB10_A2
- GL_RGBA12
- GL_RGBA16

Fixes piglit tests "EXT_framebuffer_multisample/formats {2,4}" on
Sandy Bridge and Ivy Bridge.
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
parent 530bda2a
......@@ -151,19 +151,6 @@ try_blorp_blit(struct intel_context *intel,
if (!src_mt) return false;
if (buffer_bit == GL_STENCIL_BUFFER_BIT && src_mt->stencil_mt)
src_mt = src_mt->stencil_mt;
switch (src_mt->format) {
case MESA_FORMAT_ARGB8888:
case MESA_FORMAT_X8_Z24:
case MESA_FORMAT_S8:
break; /* Supported */
default:
/* Unsupported format.
*
* TODO: need to support all formats that are allowed as multisample
* render targets.
*/
return false;
}
/* Validate destination */
if (!dst_rb) return false;
......@@ -172,19 +159,14 @@ try_blorp_blit(struct intel_context *intel,
if (!dst_mt) return false;
if (buffer_bit == GL_STENCIL_BUFFER_BIT && dst_mt->stencil_mt)
dst_mt = dst_mt->stencil_mt;
switch (dst_mt->format) {
case MESA_FORMAT_ARGB8888:
case MESA_FORMAT_X8_Z24:
case MESA_FORMAT_S8:
break; /* Supported */
default:
/* Unsupported format.
*
* TODO: need to support all formats that are allowed as multisample
* render targets.
*/
/* Blorp blits can't translate from one format to another. For that we'll
* have to fall back to the meta-op blit. Note: the meta-op blit doesn't
* support multisampled blits, but fortunately this is ok because
* multisampled blits require identical source and destination formats.
*/
if (src_mt->format != dst_mt->format)
return false;
}
/* Account for the fact that in the system framebuffer, the origin is at
* the lower left.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment