2013-04-17 21:29:41 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2010-06-13 13:50:06 -06:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "VideoBackends/D3D/D3DTexture.h"
|
|
|
|
#include "VideoCommon/TextureCacheBase.h"
|
2010-10-19 16:24:27 -06:00
|
|
|
|
|
|
|
namespace DX11
|
|
|
|
{
|
|
|
|
|
|
|
|
class TextureCache : public ::TextureCache
|
2010-06-13 13:50:06 -06:00
|
|
|
{
|
|
|
|
public:
|
2010-10-19 16:24:27 -06:00
|
|
|
TextureCache();
|
|
|
|
~TextureCache();
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct TCacheEntry : TCacheEntryBase
|
2010-06-13 13:50:06 -06:00
|
|
|
{
|
2011-06-11 13:37:21 -06:00
|
|
|
D3DTexture2D *const texture;
|
2010-06-13 13:50:06 -06:00
|
|
|
|
2010-10-19 16:24:27 -06:00
|
|
|
D3D11_USAGE usage;
|
2010-06-13 13:50:06 -06:00
|
|
|
|
2015-01-11 07:03:41 -07:00
|
|
|
TCacheEntry(const TCacheEntryConfig& config, D3DTexture2D *_tex) : TCacheEntryBase(config), texture(_tex) {}
|
2011-06-11 13:37:21 -06:00
|
|
|
~TCacheEntry();
|
2010-06-13 13:50:06 -06:00
|
|
|
|
2010-10-19 16:24:27 -06:00
|
|
|
void Load(unsigned int width, unsigned int height,
|
2014-03-10 23:55:00 -06:00
|
|
|
unsigned int expanded_width, unsigned int levels) override;
|
2010-10-19 16:24:27 -06:00
|
|
|
|
2011-02-26 16:41:02 -07:00
|
|
|
void FromRenderTarget(u32 dstAddr, unsigned int dstFormat,
|
2014-03-23 14:44:23 -06:00
|
|
|
PEControl::PixelFormat srcFormat, const EFBRectangle& srcRect,
|
2011-02-26 16:41:02 -07:00
|
|
|
bool isIntensity, bool scaleByHalf, unsigned int cbufid,
|
2014-03-10 23:55:00 -06:00
|
|
|
const float *colmat) override;
|
2010-10-19 16:24:27 -06:00
|
|
|
|
2014-03-10 23:55:00 -06:00
|
|
|
void Bind(unsigned int stage) override;
|
|
|
|
bool Save(const std::string& filename, unsigned int level) override;
|
2010-10-19 16:24:27 -06:00
|
|
|
};
|
|
|
|
|
2015-01-17 02:01:41 -07:00
|
|
|
TCacheEntryBase* CreateTexture(const TCacheEntryConfig& config) override;
|
2010-10-19 16:24:27 -06:00
|
|
|
|
2011-06-11 13:37:21 -06:00
|
|
|
u64 EncodeToRamFromTexture(u32 address, void* source_texture, u32 SourceW, u32 SourceH, bool bFromZBuffer, bool bIsIntensityFmt, u32 copyfmt, int bScaleByHalf, const EFBRectangle& source) {return 0;};
|
2014-11-03 16:53:14 -07:00
|
|
|
|
2015-01-26 16:33:23 -07:00
|
|
|
void ConvertTexture(TCacheEntryBase* entry, TCacheEntryBase* unconverted, void* palette, TlutFormat format) override;
|
|
|
|
|
2014-11-03 16:53:14 -07:00
|
|
|
void CompileShaders() override { }
|
|
|
|
void DeleteShaders() override { }
|
2015-01-26 16:33:23 -07:00
|
|
|
|
|
|
|
ID3D11Buffer* palette_buf;
|
|
|
|
ID3D11ShaderResourceView* palette_buf_srv;
|
|
|
|
ID3D11Buffer* palette_uniform;
|
|
|
|
ID3D11PixelShader* palette_pixel_shader[3];
|
2010-06-13 13:50:06 -06:00
|
|
|
};
|
2010-10-19 16:24:27 -06:00
|
|
|
|
|
|
|
}
|