diff options
author | José Fonseca <[email protected]> | 2012-11-28 19:25:05 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2012-11-29 14:08:42 +0000 |
commit | 6916387e5396a891f2ffbc68866802d03f6a0939 (patch) | |
tree | 6381dd82d6c8f244acf0860f1475b0d858ee718d /src/gallium/drivers/llvmpipe/lp_texture.c | |
parent | 9f06061d50f90bf425a5337cea1b0adb94a46d25 (diff) |
llvmpipe: Only advertise unswizzled formats.
Update llvmpipe_is_format_supported and llvmpipe_is_format_unswizzled
so that only the formats that we can render without swizzling are
advertised.
We can still render all D3D10 required formats except
PIPE_FORMAT_R11G11B10_FLOAT, which needs to be implemented in a future
opportunity.
Removal of rendertarget swizzling will be done in a subsequent change.
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_texture.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_texture.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index e6061230dd1..dcf2665dbc2 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -760,29 +760,18 @@ boolean llvmpipe_is_format_unswizzled( enum pipe_format format ) { const struct util_format_description *desc = util_format_description(format); - unsigned chan; if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN || - desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB || + (desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB && + desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB) || desc->block.width != 1 || - desc->block.height != 1) { + desc->block.height != 1 || + desc->is_mixed || + (!desc->is_array && !desc->is_bitmask)) { + assert(0); return FALSE; } - for (chan = 0; chan < desc->nr_channels; ++chan) { - if (desc->channel[chan].type == UTIL_FORMAT_TYPE_VOID && (chan + 1) == desc->nr_channels) - continue; - - if (desc->channel[chan].type != desc->channel[0].type) - return FALSE; - - if (desc->channel[chan].normalized != desc->channel[0].normalized) - return FALSE; - - if (desc->channel[chan].pure_integer != desc->channel[0].pure_integer) - return FALSE; - } - return TRUE; } |