From 442bcd7fd373b2a55c0db9ee806f6f4be64b0285 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 17 Jul 2014 14:30:29 +0100 Subject: mesa: Add texel fetch functions for BPTC-compressed textures Adds functions to fetch from any of the four BPTC-compressed formats. v2: Set the alpha component to 1.0 when fetching from the half-float formats instead of leaving it uninitialised. Don't linearize the alpha component when fetching from sRGB. Reviewed-by: Ian Romanick --- src/mesa/main/texcompress.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa/main/texcompress.c') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 53c0ea02206..b4efeee3bcc 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -42,6 +42,7 @@ #include "texcompress_rgtc.h" #include "texcompress_s3tc.h" #include "texcompress_etc.h" +#include "texcompress_bptc.h" /** @@ -610,6 +611,11 @@ _mesa_get_compressed_fetch_func(mesa_format format) return _mesa_get_compressed_rgtc_func(format); case MESA_FORMAT_ETC1_RGB8: return _mesa_get_etc_fetch_func(format); + case MESA_FORMAT_BPTC_RGBA_UNORM: + case MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM: + case MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT: + case MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT: + return _mesa_get_bptc_fetch_func(format); default: return NULL; } -- cgit v1.2.3