summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-08-17 10:12:04 -0500
committerTim Rowley <[email protected]>2016-09-08 10:43:21 -0500
commit7514e326f89843fae75a385fee25809a852ca94d (patch)
treef616c75fa6f01c88cb5b199c9c43985f7655c7a1 /src/gallium
parentb863f4a39a82a168577cd8417d20bd9ac3cc1c21 (diff)
swr: fixes for format mapping and texture sizing
Signed-off-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/swr/swr_screen.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
index 5c94877282c..2ffb3a799a7 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -55,7 +55,7 @@ extern "C" {
* Max texture sizes
* XXX Check max texture size values against core and sampler.
*/
-#define SWR_MAX_TEXTURE_SIZE (4 * 1048 * 1048 * 1024ULL) /* 4GB */
+#define SWR_MAX_TEXTURE_SIZE (4 * 1024 * 1024 * 1024ULL) /* 4GB */
#define SWR_MAX_TEXTURE_2D_LEVELS 14 /* 8K x 8K for now */
#define SWR_MAX_TEXTURE_3D_LEVELS 12 /* 2K x 2K x 2K for now */
#define SWR_MAX_TEXTURE_CUBE_LEVELS 14 /* 8K x 8K for now */
@@ -448,6 +448,20 @@ mesa_to_swr_format(enum pipe_format format)
return R32_FLOAT_X8X24_TYPELESS;
case PIPE_FORMAT_L8A8_UNORM:
return R8G8_UNORM;
+ case PIPE_FORMAT_DXT1_RGB:
+ case PIPE_FORMAT_DXT1_RGBA:
+ return BC1_UNORM;
+ case PIPE_FORMAT_DXT3_RGBA:
+ return BC2_UNORM;
+ case PIPE_FORMAT_DXT5_RGBA:
+ return BC3_UNORM;
+ case PIPE_FORMAT_DXT1_SRGB:
+ case PIPE_FORMAT_DXT1_SRGBA:
+ return BC1_UNORM_SRGB;
+ case PIPE_FORMAT_DXT3_SRGBA:
+ return BC2_UNORM_SRGB;
+ case PIPE_FORMAT_DXT5_SRGBA:
+ return BC3_UNORM_SRGB;
default:
break;
}
@@ -515,7 +529,7 @@ swr_texture_layout(struct swr_screen *screen,
SWR_FORMAT_INFO finfo = GetFormatInfo(res->swr.format);
- unsigned total_size = 0;
+ size_t total_size = 0;
unsigned width = pt->width0;
unsigned height = pt->height0;
unsigned depth = pt->depth0;