diff options
author | Dave Airlie <[email protected]> | 2011-04-19 20:42:48 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-04-19 20:44:13 +1000 |
commit | 66866d642fe8f8fba141d50a81b08793c3bd63e8 (patch) | |
tree | 91f2086fbb76513927cd2d917aaff6e6fa500b45 /src/gallium/drivers/r600/r600_state.c | |
parent | 5722286be21a2f766a5f44e19e8005023d26b959 (diff) |
r600g: add cb support for snorm formats.
Check for signed type and enable SNORM.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 3a863ae85c8..eba48f8ad74 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -742,16 +742,18 @@ static void r600_cb(struct r600_pipe_context *rctx, struct r600_pipe_state *rsta level, state->cbufs[cb]->u.tex.first_layer); pitch = rtex->pitch_in_blocks[level] / 8 - 1; slice = rtex->pitch_in_blocks[level] * surf->aligned_height / 64 - 1; - ntype = V_0280A0_NUMBER_UNORM; desc = util_format_description(surf->base.format); - if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) - ntype = V_0280A0_NUMBER_SRGB; for (i = 0; i < 4; i++) { if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID) { break; } } + ntype = V_0280A0_NUMBER_UNORM; + if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) + ntype = V_0280A0_NUMBER_SRGB; + else if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) + ntype = V_0280A0_NUMBER_SNORM; format = r600_translate_colorformat(surf->base.format); swap = r600_translate_colorswap(surf->base.format); |