CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/GPU/Directx9/TextureCacheDX9.h
Views: 1401
// Copyright (c) 2012- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include <d3d9.h>20#include <wrl/client.h>2122#include "GPU/GPU.h"23#include "GPU/GPUInterface.h"24#include "GPU/Common/TextureCacheCommon.h"2526struct VirtualFramebuffer;27class TextureShaderCache;2829class FramebufferManagerDX9;30class ShaderManagerDX9;3132class TextureCacheDX9 : public TextureCacheCommon {33public:34TextureCacheDX9(Draw::DrawContext *draw, Draw2D *draw2D);35~TextureCacheDX9();3637void StartFrame() override;3839void SetFramebufferManager(FramebufferManagerDX9 *fbManager);4041void ForgetLastTexture() override;4243bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override;4445void DeviceLost() override { draw_ = nullptr; }46void DeviceRestore(Draw::DrawContext *draw) override { draw_ = draw; }4748protected:49void BindTexture(TexCacheEntry *entry) override;50void Unbind() override;51void ReleaseTexture(TexCacheEntry *entry, bool delete_them) override;52void BindAsClutTexture(Draw::Texture *tex, bool smooth) override;53void *GetNativeTextureView(const TexCacheEntry *entry) override;5455private:56void ApplySamplingParams(const SamplerCacheKey &key) override;5758D3DFORMAT GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const;59void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override;6061void BuildTexture(TexCacheEntry *const entry) override;6263static LPDIRECT3DBASETEXTURE9 &DxTex(const TexCacheEntry *entry) {64return *(LPDIRECT3DBASETEXTURE9 *)&entry->texturePtr;65}6667Microsoft::WRL::ComPtr<IDirect3DDevice9> device_;68Microsoft::WRL::ComPtr<IDirect3DDevice9Ex> deviceEx_;6970Microsoft::WRL::ComPtr<IDirect3DVertexDeclaration9> pFramebufferVertexDecl;7172IDirect3DBaseTexture9 *lastBoundTexture = nullptr;73float maxAnisotropyLevel;7475FramebufferManagerDX9 *framebufferManagerDX9_;76};7778D3DFORMAT getClutDestFormat(GEPaletteFormat format);798081