2013-04-18 03:29:41 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
#ifndef _TEXTURECACHE_H
|
|
|
|
#define _TEXTURECACHE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "D3DBase.h"
|
2009-09-03 21:56:08 +00:00
|
|
|
#include "VideoCommon.h"
|
2009-06-22 09:31:30 +00:00
|
|
|
#include "BPMemory.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2010-10-19 22:24:27 +00:00
|
|
|
#include "TextureCacheBase.h"
|
|
|
|
|
|
|
|
namespace DX9
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
|
|
|
|
2010-10-19 22:24:27 +00:00
|
|
|
class TextureCache : public ::TextureCache
|
|
|
|
{
|
2009-03-07 18:05:29 +00:00
|
|
|
private:
|
2010-10-19 22:24:27 +00:00
|
|
|
struct TCacheEntry : TCacheEntryBase
|
|
|
|
{
|
|
|
|
const LPDIRECT3DTEXTURE9 texture;
|
|
|
|
|
|
|
|
D3DFORMAT d3d_fmt;
|
|
|
|
bool swap_r_b;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2010-10-19 22:24:27 +00:00
|
|
|
TCacheEntry(LPDIRECT3DTEXTURE9 _tex) : texture(_tex) {}
|
|
|
|
~TCacheEntry();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2010-10-19 22:24:27 +00:00
|
|
|
void Load(unsigned int width, unsigned int height,
|
2012-08-10 11:13:51 +00:00
|
|
|
unsigned int expanded_width, unsigned int levels);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2011-02-26 23:41:02 +00: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-19 22:24:27 +00:00
|
|
|
|
|
|
|
void Bind(unsigned int stage);
|
2012-05-12 11:50:03 +00:00
|
|
|
bool Save(const char filename[], unsigned int level);
|
2010-10-19 22:24:27 +00: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 04:46:09 +00:00
|
|
|
};
|
|
|
|
|
2010-10-19 22:24:27 +00:00
|
|
|
}
|
|
|
|
|
2010-06-02 20:35:12 +00:00
|
|
|
#endif
|