r600g: add support for signed normalized frame buffers

This commit is contained in:
Christian König 2010-11-20 21:06:42 +01:00
parent e639e1b83e
commit 749504a935
2 changed files with 13 additions and 0 deletions

View file

@ -844,6 +844,17 @@ static void r600_cb(struct r600_pipe_context *rctx, struct r600_pipe_state *rsta
desc = util_format_description(rtex->resource.base.b.format);
if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB)
ntype = V_0280A0_NUMBER_SRGB;
else if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN) {
switch(desc->channel[0].type) {
case UTIL_FORMAT_TYPE_UNSIGNED:
ntype = V_0280A0_NUMBER_UNORM;
break;
case UTIL_FORMAT_TYPE_SIGNED:
ntype = V_0280A0_NUMBER_SNORM;
break;
}
}
format = r600_translate_colorformat(rtex->resource.base.b.format);
swap = r600_translate_colorswap(rtex->resource.base.b.format);

View file

@ -308,6 +308,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
return V_0280A0_SWAP_STD;
case PIPE_FORMAT_R16_UNORM:
case PIPE_FORMAT_R16_SNORM:
return V_0280A0_SWAP_STD;
/* 32-bit buffers. */
@ -400,6 +401,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
return V_0280A0_COLOR_8_8;
case PIPE_FORMAT_R16_UNORM:
case PIPE_FORMAT_R16_SNORM:
return V_0280A0_COLOR_16;
/* 32-bit buffers. */