First version of MSAA code added. No UI yet. No CSAA yet. Doesn't work in Zeldas and Metroids for unknown reason.

Automatic texture invalidation when using copy efb to ram (fixes weird flickery scanner in metroid 2). 

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2617 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-03-08 19:19:51 +00:00
parent c7a45ecf95
commit c6ffcec991
12 changed files with 346 additions and 148 deletions

View File

@ -29,10 +29,11 @@ class TextureMngr
public:
struct TCacheEntry
{
TCacheEntry() : texture(0), addr(0), hash(0), w(0), h(0), isRenderTarget(false), isUpsideDown(false), isNonPow2(true), bHaveMipMaps(false) { mode.hex = 0xFCFCFCFC; }
TCacheEntry() : texture(0), addr(0), size_in_bytes(0), hash(0), w(0), h(0), isRenderTarget(false), isUpsideDown(false), isNonPow2(true), bHaveMipMaps(false) { mode.hex = 0xFCFCFCFC; }
GLuint texture;
u32 addr;
u32 size_in_bytes;
u32 hash;
u32 paletteHash;
u32 hashoffset;
@ -40,7 +41,7 @@ public:
TexMode0 mode; // current filter and clamp modes that texture is set to
int frameCount;
int w,h,fmt;
int w, h, fmt;
bool isRenderTarget; // if render texture, then rendertex is filled with the direct copy of the render target
// later conversions would have to convert properly from rendertexfmt to texfmt
@ -51,6 +52,7 @@ public:
void SetTextureParameters(TexMode0& newmode);
void Destroy(bool shutdown);
void ConvertFromRenderTarget(u32 taddr, int twidth, int theight, int tformat, int tlutaddr, int tlutfmt);
bool IntersectsMemoryRange(u32 range_address, u32 range_size);
};
struct DEPTHTARGET
@ -73,6 +75,8 @@ public:
static void ProgressiveCleanup();
static void Shutdown();
static void Invalidate(bool shutdown);
static void InvalidateRange(u32 start_address, u32 size);
static TCacheEntry* Load(int texstage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt);
static void CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool bIsIntensityFmt, u32 copyfmt, bool bScaleByHalf, const TRectangle &source);