summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_screen.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-04-01 02:14:52 +0200
committerMarek Olšák <[email protected]>2010-04-01 02:14:52 +0200
commit3252651fb291d7e6e4af5fed8ab461f603574cd6 (patch)
treef5e7f6c743e15eb3047d7b409d6e4e3f3b88fe10 /src/gallium/drivers/r300/r300_screen.c
parent39e116e3a0dce1a13dbb4395585cd3873e5ed073 (diff)
r300g: add RGTC texture support
The CS checker already knows about this.
Diffstat (limited to 'src/gallium/drivers/r300/r300_screen.c')
-rw-r--r--src/gallium/drivers/r300/r300_screen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 090964b0254..50e5e9307e9 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -207,9 +207,14 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
{
uint32_t retval = 0;
boolean is_r500 = r300_screen(screen)->caps->is_r500;
+ boolean is_r400 = r300_screen(screen)->caps->is_r400;
boolean is_z24 = format == PIPE_FORMAT_X8Z24_UNORM ||
format == PIPE_FORMAT_S8_USCALED_Z24_UNORM;
boolean is_color2101010 = format == PIPE_FORMAT_R10G10B10A2_UNORM;
+ boolean is_ati1n = format == PIPE_FORMAT_RGTC1_UNORM ||
+ format == PIPE_FORMAT_RGTC1_SNORM;
+ boolean is_ati2n = format == PIPE_FORMAT_RGTC2_UNORM ||
+ format == PIPE_FORMAT_RGTC2_SNORM;
if (target >= PIPE_MAX_TEXTURE_TYPES) {
fprintf(stderr, "r300: Implementation error: Received bogus texture "
@@ -221,6 +226,10 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
if ((usage & PIPE_TEXTURE_USAGE_SAMPLER) &&
/* Z24 cannot be sampled from on non-r5xx. */
(is_r500 || !is_z24) &&
+ /* ATI1N is r5xx-only. */
+ (is_r500 || !is_ati1n) &&
+ /* ATI2N is supported on r4xx-r5xx. */
+ (is_r400 || is_r500 || !is_ati2n) &&
r300_is_sampler_format_supported(format)) {
retval |= PIPE_TEXTURE_USAGE_SAMPLER;
}