From: Marek Olšák Date: Fri, 25 Jan 2013 23:27:27 +0000 (+0100) Subject: r300g: use new RGBX formats X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27e216a07501f4d2ade1e1ec8b9a1f709304013b;p=mesa.git r300g: use new RGBX formats --- diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index ebc8a2e958d..60759160b0e 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -468,6 +468,9 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, /* Check sampler format support. */ if ((usage & PIPE_BIND_SAMPLER_VIEW) && + /* these two are broken for an unknown reason */ + format != PIPE_FORMAT_R8G8B8X8_SNORM && + format != PIPE_FORMAT_R16G16B16X16_SNORM && /* ATI1N is r5xx-only. */ (is_r500 || !is_ati1n) && /* ATI2N is supported on r4xx-r5xx. */ diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index b33c2f37a42..e4cb967e9f3 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -449,7 +449,7 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) case PIPE_FORMAT_R8G8B8A8_UNORM: case PIPE_FORMAT_R8G8B8A8_SNORM: case PIPE_FORMAT_R8G8B8X8_UNORM: - /*case PIPE_FORMAT_R8G8B8X8_SNORM:*/ + case PIPE_FORMAT_R8G8B8X8_SNORM: /* These formats work fine with ARGB8888 if US_OUT_FMT is set * correctly. */ case PIPE_FORMAT_R16G16_UNORM: @@ -467,12 +467,16 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) case PIPE_FORMAT_R10G10B10A2_UNORM: case PIPE_FORMAT_R10G10B10X2_SNORM: case PIPE_FORMAT_B10G10R10A2_UNORM: + case PIPE_FORMAT_B10G10R10X2_UNORM: return R500_COLOR_FORMAT_ARGB2101010; /* R5xx-only? */ /* 64-bit buffers. */ case PIPE_FORMAT_R16G16B16A16_UNORM: case PIPE_FORMAT_R16G16B16A16_SNORM: case PIPE_FORMAT_R16G16B16A16_FLOAT: + case PIPE_FORMAT_R16G16B16X16_UNORM: + case PIPE_FORMAT_R16G16B16X16_SNORM: + case PIPE_FORMAT_R16G16B16X16_FLOAT: /* These formats work fine with ARGB16161616 if US_OUT_FMT is set * correctly. */ case PIPE_FORMAT_R32G32_FLOAT: @@ -481,6 +485,7 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) /* 128-bit buffers. */ case PIPE_FORMAT_R32G32B32A32_FLOAT: + case PIPE_FORMAT_R32G32B32X32_FLOAT: return R300_COLOR_FORMAT_ARGB32323232; /* YUV buffers. */ @@ -648,6 +653,7 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) case PIPE_FORMAT_B8G8R8X8_UNORM: /*case PIPE_FORMAT_B8G8R8X8_SNORM:*/ case PIPE_FORMAT_B10G10R10A2_UNORM: + case PIPE_FORMAT_B10G10R10X2_UNORM: return modifier | R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A; @@ -663,7 +669,7 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) /* RGBA outputs. */ case PIPE_FORMAT_R8G8B8X8_UNORM: - /*case PIPE_FORMAT_R8G8B8X8_SNORM:*/ + case PIPE_FORMAT_R8G8B8X8_SNORM: case PIPE_FORMAT_R8G8B8A8_UNORM: case PIPE_FORMAT_R8G8B8A8_SNORM: case PIPE_FORMAT_R10G10B10A2_UNORM: @@ -679,6 +685,7 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) case PIPE_FORMAT_R16G16B16A16_FLOAT: case PIPE_FORMAT_R32_FLOAT: case PIPE_FORMAT_R32G32B32A32_FLOAT: + case PIPE_FORMAT_R32G32B32X32_FLOAT: case PIPE_FORMAT_L16_UNORM: case PIPE_FORMAT_L16_SNORM: case PIPE_FORMAT_L16_FLOAT: @@ -687,6 +694,9 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) case PIPE_FORMAT_I16_SNORM: case PIPE_FORMAT_I16_FLOAT: case PIPE_FORMAT_I32_FLOAT: + case PIPE_FORMAT_R16G16B16X16_UNORM: + case PIPE_FORMAT_R16G16B16X16_SNORM: + case PIPE_FORMAT_R16G16B16X16_FLOAT: return modifier | R300_C0_SEL_R | R300_C1_SEL_G | R300_C2_SEL_B | R300_C3_SEL_A; @@ -746,6 +756,7 @@ static uint32_t r300_translate_colormask_swizzle(enum pipe_format format) case PIPE_FORMAT_B4G4R4X4_UNORM: case PIPE_FORMAT_B8G8R8X8_UNORM: /*case PIPE_FORMAT_B8G8R8X8_SNORM:*/ + case PIPE_FORMAT_B10G10R10X2_UNORM: return COLORMASK_BGRX; case PIPE_FORMAT_B5G6R5_UNORM: @@ -757,8 +768,13 @@ static uint32_t r300_translate_colormask_swizzle(enum pipe_format format) return COLORMASK_BGRA; case PIPE_FORMAT_R8G8B8X8_UNORM: + /* RGBX_SNORM formats are broken for an unknown reason */ /*case PIPE_FORMAT_R8G8B8X8_SNORM:*/ - case PIPE_FORMAT_R10G10B10X2_SNORM: + /*case PIPE_FORMAT_R10G10B10X2_SNORM:*/ + case PIPE_FORMAT_R16G16B16X16_UNORM: + /*case PIPE_FORMAT_R16G16B16X16_SNORM:*/ + case PIPE_FORMAT_R16G16B16X16_FLOAT: + case PIPE_FORMAT_R32G32B32X32_FLOAT: return COLORMASK_RGBX; case PIPE_FORMAT_R8G8B8A8_UNORM: