diff options
author | Alex Deucher <[email protected]> | 2010-01-19 01:42:41 -0500 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2010-01-19 01:42:41 -0500 |
commit | 2b1d5ea4f0250a6a7fa312ced0a7af85e909381b (patch) | |
tree | 83cc630a6f623690747b41802f0969e63fb663ff /src/mesa/drivers/dri/radeon | |
parent | a67cd1994f3474dd638af76b2bf5b19490863cba (diff) |
r100/r200/r600: check if blitting for given format is supported earlier
based on Maciej's r300 patch.
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_blit.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index bc46018255d..d9343b30641 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -37,6 +37,29 @@ static inline uint32_t cmdpacket0(struct radeon_screen *rscrn, return CP_PACKET2; } +/* common formats supported as both textures and render targets */ +static unsigned is_blit_supported(gl_format mesa_format) +{ + /* XXX others? BE/LE? */ + switch (mesa_format) { + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_RGB565: + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_A8: + break; + default: + return 0; + } + + /* ??? */ + if (_mesa_get_format_bits(mesa_format, GL_DEPTH_BITS) > 0) + return 0; + + return 1; +} + static inline void emit_vtx_state(struct r100_context *r100) { BATCH_LOCALS(&r100->radeon); @@ -305,7 +328,7 @@ GLboolean r100_blit(struct r100_context *r100, unsigned reg_height, unsigned flip_y) { - if (_mesa_get_format_bits(src_mesaformat, GL_DEPTH_BITS) > 0) + if (is_blit_supported(dst_mesaformat)) return GL_FALSE; /* Make sure that colorbuffer has even width - hw limitation */ |