Fix mipmap generation bug

Fix crash due to dc_source2 not always being set
Add r_lod_bias to control mipmap selection
Improve LOD calculations to take the U texture coordinate into account
This commit is contained in:
Magnus Norddahl 2016-11-05 16:12:59 +01:00
commit d084f77546
7 changed files with 50 additions and 25 deletions

View file

@ -60,6 +60,9 @@ CVAR(Bool, r_minfilter, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
// Use mipmapped textures
CVAR(Bool, r_mipmap, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
// Level of detail texture bias
CVAR(Float, r_lod_bias, -1.5, 0); // To do: add CVAR_ARCHIVE | CVAR_GLOBALCONFIG when a good default has been decided
/////////////////////////////////////////////////////////////////////////////
class DrawSpanLLVMCommand : public DrawerCommand
@ -377,7 +380,7 @@ public:
if (dc_shade_constants.simple_shade)
args.flags |= DrawColumnArgs::simple_shade;
if (args.source2 == nullptr)
args.flags |= DrawWallArgs::nearest_filter;
args.flags |= DrawColumnArgs::nearest_filter;
DetectRangeError(args.dest, args.dest_y, args.count);
}