driver-compress-textures

This commit is contained in:
David Rose 2009-01-15 00:08:10 +00:00
parent b2604316e5
commit 31f9d1994e
3 changed files with 19 additions and 19 deletions

View File

@ -112,16 +112,18 @@ ConfigVariableBool compressed_textures
"changes the meaning of set_compression(Texture::CM_default) to "
"Texture::CM_on."));
ConfigVariableBool cpu_compress_textures
("cpu-compress-textures", false,
PRC_DESC("Set this true to use the squish library to compress textures on "
"the CPU, as they are loaded, rather than to hand them off to "
"the graphics driver to compress them. This will be done "
"only if the graphics window is already open and is the default "
"graphics context, and it claims to support DXT1/3/5 "
"compression. If any of this is not true, the texture will "
"not be automatically compressed via squish, but it may still "
"be compressed by the graphics driver."));
ConfigVariableBool driver_compress_textures
("driver-compress-textures", false,
PRC_DESC("Set this true to ask the graphics driver to compress textures, "
"rather than compressing them in-memory first. Depending on "
"your graphics driver, you may or may not get better performance "
"or results by setting this true. Setting it true may also "
"allow you to take advantage of some exotic compression algorithm "
"other than DXT1/3/5 that your graphics driver supports, but "
"which is unknown to Panda. If the libsquish library is not "
"compiled into Panda, textures cannot be compressed in-memory, "
"and will always be handed to the graphics driver, regardless "
"of this setting."));
ConfigVariableBool vertex_buffers
("vertex-buffers", true,

View File

@ -55,7 +55,7 @@ extern EXPCL_PANDA_GOBJ ConfigVariableList exclude_texture_scale;
extern EXPCL_PANDA_GOBJ ConfigVariableBool keep_texture_ram;
extern EXPCL_PANDA_GOBJ ConfigVariableBool compressed_textures;
extern EXPCL_PANDA_GOBJ ConfigVariableBool cpu_compress_textures;
extern EXPCL_PANDA_GOBJ ConfigVariableBool driver_compress_textures;
extern EXPCL_PANDA_GOBJ ConfigVariableBool vertex_buffers;
extern EXPCL_PANDA_GOBJ ConfigVariableBool vertex_arrays;
extern EXPCL_PANDA_GOBJ ConfigVariableBool display_lists;

View File

@ -3162,7 +3162,7 @@ do_make_ram_mipmap_image(int n) {
////////////////////////////////////////////////////////////////////
bool Texture::
consider_auto_compress_ram_image() {
if (cpu_compress_textures) {
if (!driver_compress_textures) {
CompressionMode compression = _compression;
if (compression == CM_default) {
if (!compressed_textures) {
@ -3172,13 +3172,11 @@ consider_auto_compress_ram_image() {
}
if (compression != CM_off && _ram_image_compression == CM_off) {
GraphicsStateGuardianBase *gsg = GraphicsStateGuardianBase::get_default_gsg();
if (gsg != (GraphicsStateGuardianBase *)NULL) {
if (do_compress_ram_image(compression, QL_default, gsg)) {
gobj_cat.info()
<< "Compressed " << get_name() << " with "
<< _ram_image_compression << "\n";
return true;
}
if (do_compress_ram_image(compression, QL_default, gsg)) {
gobj_cat.info()
<< "Compressed " << get_name() << " with "
<< _ram_image_compression << "\n";
return true;
}
}
}