diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 8fc1d5a..63d5d6b 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -22,6 +22,7 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "util/u_format.h" +#include "util/u_format_s3tc.h" #include "util/u_memory.h" #include "r300_context.h" @@ -213,6 +214,11 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, format == PIPE_FORMAT_RGTC1_SNORM; boolean is_ati2n = format == PIPE_FORMAT_RGTC2_UNORM || format == PIPE_FORMAT_RGTC2_SNORM; + const struct util_format_description *format_desc; + + format_desc = util_format_description(format); + if (!format_desc) + return FALSE; if (target >= PIPE_MAX_TEXTURE_TYPES) { fprintf(stderr, "r300: Implementation error: Received bogus texture " @@ -253,6 +259,10 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, retval |= PIPE_BIND_DEPTH_STENCIL; } + if (format_desc->layout == UTIL_FORMAT_LAYOUT_S3TC) { + retval |= PIPE_BIND_SAMPLER_VIEW; + } + return retval == usage; } @@ -319,6 +329,8 @@ struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws) r300_init_screen_resource_functions(r300screen); + util_format_s3tc_init(); + return &r300screen->screen; }