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/GLES/TextureCacheGLES.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 "Common/GPU/OpenGL/GLFeatures.h"20#include "Common/GPU/OpenGL/GLCommon.h"21#include "Common/GPU/OpenGL/GLRenderManager.h"22#include "Common/GPU/thin3d.h"23#include "GPU/GPUInterface.h"24#include "GPU/GPUState.h"25#include "GPU/Common/TextureCacheCommon.h"2627struct VirtualFramebuffer;28class FramebufferManagerGLES;29class TextureShaderCache;30class ShaderManagerGLES;31class DrawEngineGLES;32class GLRTexture;3334class TextureCacheGLES : public TextureCacheCommon {35public:36TextureCacheGLES(Draw::DrawContext *draw, Draw2D *draw2D);37~TextureCacheGLES();3839void Clear(bool delete_them) override;40void StartFrame() override;4142void SetFramebufferManager(FramebufferManagerGLES *fbManager);43void SetDepalShaderCache(TextureShaderCache *dpCache) {44textureShaderCache_ = dpCache;45}46void SetDrawEngine(DrawEngineGLES *td) {47drawEngine_ = td;48}4950void ForgetLastTexture() override {51lastBoundTexture = nullptr;52}5354bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override;5556void DeviceLost() override;57void DeviceRestore(Draw::DrawContext *draw) override;5859protected:60void BindTexture(TexCacheEntry *entry) override;61void Unbind() override;62void ReleaseTexture(TexCacheEntry *entry, bool delete_them) override;6364void BindAsClutTexture(Draw::Texture *tex, bool smooth) override;65void *GetNativeTextureView(const TexCacheEntry *entry) override;6667private:68void ApplySamplingParams(const SamplerCacheKey &key) override;69static Draw::DataFormat GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) ;7071void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override;72void BuildTexture(TexCacheEntry *const entry) override;7374GLRenderManager *render_;7576GLRTexture *lastBoundTexture = nullptr;7778FramebufferManagerGLES *framebufferManagerGL_;79DrawEngineGLES *drawEngine_;8081enum { INVALID_TEX = -1 };82};8384Draw::DataFormat getClutDestFormat(GEPaletteFormat format);858687