2013-04-18 06:29:41 +03:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 06:46:09 +02:00
|
|
|
|
|
|
|
#ifndef _TEXTURECACHE_H
|
|
|
|
#define _TEXTURECACHE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "D3DBase.h"
|
2009-09-04 00:56:08 +03:00
|
|
|
#include "VideoCommon.h"
|
2009-06-22 12:31:30 +03:00
|
|
|
#include "BPMemory.h"
|
2008-12-08 06:46:09 +02:00
|
|
|
|
2010-10-20 01:24:27 +03:00
|
|
|
#include "TextureCacheBase.h"
|
|
|
|
|
|
|
|
namespace DX9
|
2008-12-08 06:46:09 +02:00
|
|
|
{
|
|
|
|
|
2010-10-20 01:24:27 +03:00
|
|
|
class TextureCache : public ::TextureCache
|
|
|
|
{
|
2009-03-07 20:05:29 +02:00
|
|
|
private:
|
2010-10-20 01:24:27 +03:00
|
|
|
struct TCacheEntry : TCacheEntryBase
|
|
|
|
{
|
|
|
|
const LPDIRECT3DTEXTURE9 texture;
|
|
|
|
|
|
|
|
D3DFORMAT d3d_fmt;
|
|
|
|
bool swap_r_b;
|
2008-12-08 06:46:09 +02:00
|
|
|
|
2010-10-20 01:24:27 +03:00
|
|
|
TCacheEntry(LPDIRECT3DTEXTURE9 _tex) : texture(_tex) {}
|
|
|
|
~TCacheEntry();
|
2008-12-08 06:46:09 +02:00
|
|
|
|
2010-10-20 01:24:27 +03:00
|
|
|
void Load(unsigned int width, unsigned int height,
|
2012-08-10 14:13:51 +03:00
|
|
|
unsigned int expanded_width, unsigned int levels);
|
2008-12-08 06:46:09 +02:00
|
|
|
|
2011-02-27 01:41:02 +02:00
|
|
|
void FromRenderTarget(u32 dstAddr, unsigned int dstFormat,
|
|
|
|
unsigned int srcFormat, const EFBRectangle& srcRect,
|
|
|
|
bool isIntensity, bool scaleByHalf, unsigned int cbufid,
|
|
|
|
const float *colmat);
|
2010-10-20 01:24:27 +03:00
|
|
|
|
|
|
|
void Bind(unsigned int stage);
|
2012-05-12 14:50:03 +03:00
|
|
|
bool Save(const char filename[], unsigned int level);
|
2010-10-20 01:24:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
TCacheEntryBase* CreateTexture(unsigned int width, unsigned int height,
|
|
|
|
unsigned int expanded_width, unsigned int tex_levels, PC_TexFormat pcfmt);
|
|
|
|
|
|
|
|
TCacheEntryBase* CreateRenderTargetTexture(unsigned int scaled_tex_w, unsigned int scaled_tex_h);
|
2008-12-08 06:46:09 +02:00
|
|
|
};
|
|
|
|
|
2010-10-20 01:24:27 +03:00
|
|
|
}
|
|
|
|
|
2010-06-02 23:35:12 +03:00
|
|
|
#endif
|