summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Novotný <noviktor@seznam.cz>2012-05-01 13:23:51 (GMT)
committerFrancisco Jerez <currojerez@riseup.net>2012-05-02 01:14:29 (GMT)
commit83a02427e576a5126a618c13bc3e12ff2b4a3e0a (patch)
tree2cc59d34fe6adaa92dd62916e1b82c09f5e45209
parent6d5efe96ee710ca1dd5f745f74a5bbfa4fd42fd9 (diff)
dri/nv10-nv20: Add support for S3TC
Signed-off-by: Viktor Novotný <noviktor@seznam.cz> Signed-off-by: Francisco Jerez <currojerez@riseup.net>
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_context.c4
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state_tex.c10
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_context.c4
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_state_tex.c10
4 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c
index 90c1545..a2448ca 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_context.c
@@ -449,6 +449,10 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
ctx->Extensions.ARB_texture_env_dot3 = true;
ctx->Extensions.NV_fog_distance = true;
ctx->Extensions.NV_texture_rectangle = true;
+ if (ctx->Mesa_DXTn) {
+ ctx->Extensions.EXT_texture_compression_s3tc = true;
+ ctx->Extensions.S3_s3tc = true;
+ }
/* GL constants. */
ctx->Const.MaxTextureLevels = 12;
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
index 0254341..b467bb3 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
@@ -111,6 +111,16 @@ get_tex_format_pot(struct gl_texture_image *ti)
case MESA_FORMAT_L8:
return NV10_3D_TEX_FORMAT_FORMAT_L8;
+ case MESA_FORMAT_RGB_DXT1:
+ case MESA_FORMAT_RGBA_DXT1:
+ return NV10_3D_TEX_FORMAT_FORMAT_DXT1;
+
+ case MESA_FORMAT_RGBA_DXT3:
+ return NV10_3D_TEX_FORMAT_FORMAT_DXT3;
+
+ case MESA_FORMAT_RGBA_DXT5:
+ return NV10_3D_TEX_FORMAT_FORMAT_DXT5;
+
default:
assert(0);
}
diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c
index c911717..5a36c87 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_context.c
@@ -460,6 +460,10 @@ nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visua
ctx->Extensions.ARB_texture_env_dot3 = true;
ctx->Extensions.NV_fog_distance = true;
ctx->Extensions.NV_texture_rectangle = true;
+ if (ctx->Mesa_DXTn) {
+ ctx->Extensions.EXT_texture_compression_s3tc = true;
+ ctx->Extensions.S3_s3tc = true;
+ }
/* GL constants. */
ctx->Const.MaxTextureCoordUnits = NV20_TEXTURE_UNITS;
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
index 799510d..d8bfdf2 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
@@ -108,6 +108,16 @@ get_tex_format_pot(struct gl_texture_image *ti)
case MESA_FORMAT_L8:
return NV20_3D_TEX_FORMAT_FORMAT_L8;
+ case MESA_FORMAT_RGB_DXT1:
+ case MESA_FORMAT_RGBA_DXT1:
+ return NV20_3D_TEX_FORMAT_FORMAT_DXT1;
+
+ case MESA_FORMAT_RGBA_DXT3:
+ return NV20_3D_TEX_FORMAT_FORMAT_DXT3;
+
+ case MESA_FORMAT_RGBA_DXT5:
+ return NV20_3D_TEX_FORMAT_FORMAT_DXT5;
+
default:
assert(0);
}