~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to GPU/Directx9/DepalettizeShaderDX9.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2014- PPSSPP Project.
 
2
 
 
3
// This program is free software: you can redistribute it and/or modify
 
4
// it under the terms of the GNU General Public License as published by
 
5
// the Free Software Foundation, version 2.0 or later versions.
 
6
 
 
7
// This program is distributed in the hope that it will be useful,
 
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
// GNU General Public License 2.0 for more details.
 
11
 
 
12
// A copy of the GPL 2.0 should have been included with the program.
 
13
// If not, see http://www.gnu.org/licenses/
 
14
 
 
15
// Official git repository and contact information can be found at
 
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
 
17
 
 
18
#include <map>
 
19
 
 
20
#include "Common/CommonTypes.h"
 
21
#include "GPU/ge_constants.h"
 
22
 
 
23
#include "GPU/Directx9/helper/global.h"
 
24
 
 
25
namespace DX9 {
 
26
 
 
27
class DepalShaderDX9 {
 
28
public:
 
29
        LPDIRECT3DPIXELSHADER9 pixelShader;
 
30
};
 
31
 
 
32
class DepalTextureDX9 {
 
33
public:
 
34
        LPDIRECT3DTEXTURE9 texture;
 
35
        int lastFrame;
 
36
};
 
37
 
 
38
// Caches both shaders and palette textures.
 
39
class DepalShaderCacheDX9 {
 
40
public:
 
41
        DepalShaderCacheDX9();
 
42
        ~DepalShaderCacheDX9();
 
43
 
 
44
        // This also uploads the palette and binds the correct texture.
 
45
        LPDIRECT3DPIXELSHADER9 GetDepalettizePixelShader(GEPaletteFormat clutFormat, GEBufferFormat pixelFormat);
 
46
        LPDIRECT3DVERTEXSHADER9 GetDepalettizeVertexShader() { return vertexShader_; }
 
47
        LPDIRECT3DTEXTURE9 GetClutTexture(GEPaletteFormat clutFormat, const u32 clutHash, u32 *rawClut);
 
48
        void Clear();
 
49
        void Decimate();
 
50
 
 
51
private:
 
52
        u32 GenerateShaderID(GEPaletteFormat clutFormat, GEBufferFormat pixelFormat);
 
53
 
 
54
        LPDIRECT3DVERTEXSHADER9 vertexShader_;
 
55
        std::map<u32, DepalShaderDX9 *> cache_;
 
56
        std::map<u32, DepalTextureDX9 *> texCache_;
 
57
};
 
58
 
 
59
}  // namespace
 
 
b'\\ No newline at end of file'