mirror of
https://github.com/libretro/ppsspp.git
synced 2025-03-03 06:06:35 +00:00
D3D9: Use an unordered_map for offscreen.
Also cleanup. Mostly just for consistent usage.
This commit is contained in:
parent
e90b01d9ac
commit
2ab1552f2d
@ -82,12 +82,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
|
||||
};
|
||||
|
||||
FramebufferManagerDX9::FramebufferManagerDX9(Draw::DrawContext *draw)
|
||||
: FramebufferManagerCommon(draw),
|
||||
drawPixelsTex_(0),
|
||||
convBuf(0),
|
||||
stencilUploadPS_(nullptr),
|
||||
stencilUploadVS_(nullptr),
|
||||
stencilUploadFailed_(false) {
|
||||
: FramebufferManagerCommon(draw) {
|
||||
|
||||
device_ = (LPDIRECT3DDEVICE9)draw->GetNativeObject(Draw::NativeObject::DEVICE);
|
||||
deviceEx_ = (LPDIRECT3DDEVICE9)draw->GetNativeObject(Draw::NativeObject::DEVICE_EX);
|
||||
@ -119,8 +114,8 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
|
||||
if (drawPixelsTex_) {
|
||||
drawPixelsTex_->Release();
|
||||
}
|
||||
for (auto it = offscreenSurfaces_.begin(), end = offscreenSurfaces_.end(); it != end; ++it) {
|
||||
it->second.surface->Release();
|
||||
for (auto &it : offscreenSurfaces_) {
|
||||
it.second.surface->Release();
|
||||
}
|
||||
delete [] convBuf;
|
||||
if (stencilUploadPS_) {
|
||||
@ -680,7 +675,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
|
||||
int age = frameLastFramebufUsed_ - it->second.last_frame_used;
|
||||
if (age > FBO_OLD_AGE) {
|
||||
it->second.surface->Release();
|
||||
offscreenSurfaces_.erase(it++);
|
||||
it = offscreenSurfaces_.erase(it);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
@ -706,8 +701,8 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
|
||||
}
|
||||
bvfbs_.clear();
|
||||
|
||||
for (auto it = offscreenSurfaces_.begin(), end = offscreenSurfaces_.end(); it != end; ++it) {
|
||||
it->second.surface->Release();
|
||||
for (auto &it : offscreenSurfaces_) {
|
||||
it.second.surface->Release();
|
||||
}
|
||||
offscreenSurfaces_.clear();
|
||||
|
||||
|
@ -17,9 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <d3d9.h>
|
||||
|
||||
@ -91,20 +89,20 @@ private:
|
||||
LPDIRECT3DDEVICE9 deviceEx_;
|
||||
|
||||
// Used by DrawPixels
|
||||
LPDIRECT3DTEXTURE9 drawPixelsTex_;
|
||||
LPDIRECT3DTEXTURE9 drawPixelsTex_ = nullptr;
|
||||
int drawPixelsTexW_;
|
||||
int drawPixelsTexH_;
|
||||
|
||||
LPDIRECT3DVERTEXSHADER9 pFramebufferVertexShader;
|
||||
LPDIRECT3DPIXELSHADER9 pFramebufferPixelShader;
|
||||
LPDIRECT3DVERTEXDECLARATION9 pFramebufferVertexDecl;
|
||||
LPDIRECT3DVERTEXSHADER9 pFramebufferVertexShader = nullptr;
|
||||
LPDIRECT3DPIXELSHADER9 pFramebufferPixelShader = nullptr;
|
||||
LPDIRECT3DVERTEXDECLARATION9 pFramebufferVertexDecl = nullptr;
|
||||
|
||||
u8 *convBuf;
|
||||
u8 *convBuf = nullptr;
|
||||
|
||||
int plainColorLoc_;
|
||||
LPDIRECT3DPIXELSHADER9 stencilUploadPS_;
|
||||
LPDIRECT3DVERTEXSHADER9 stencilUploadVS_;
|
||||
bool stencilUploadFailed_;
|
||||
LPDIRECT3DPIXELSHADER9 stencilUploadPS_ = nullptr;
|
||||
LPDIRECT3DVERTEXSHADER9 stencilUploadVS_ = nullptr;
|
||||
bool stencilUploadFailed_ = false;
|
||||
|
||||
TextureCacheDX9 *textureCacheDX9_;
|
||||
ShaderManagerDX9 *shaderManagerDX9_;
|
||||
@ -115,12 +113,7 @@ private:
|
||||
int last_frame_used;
|
||||
};
|
||||
|
||||
std::map<u64, OffscreenSurface> offscreenSurfaces_;
|
||||
|
||||
#if 0
|
||||
AsyncPBO *pixelBufObj_; //this isn't that large
|
||||
u8 currentPBO_;
|
||||
#endif
|
||||
std::unordered_map<u64, OffscreenSurface> offscreenSurfaces_;
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user