mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GPU: Move "if (resized_)" to BeginHostFrame to avoid desynchronized settings.
Also wipe the input layout cache on D3D11 on resize. Fixes #9438.
This commit is contained in:
parent
20f9ae3114
commit
94f16e3b7c
6 changed files with 38 additions and 24 deletions
|
@ -58,7 +58,7 @@ public:
|
||||||
std::vector<std::string> DebugGetVertexLoaderIDs();
|
std::vector<std::string> DebugGetVertexLoaderIDs();
|
||||||
std::string DebugGetVertexLoaderString(std::string id, DebugShaderStringType stringType);
|
std::string DebugGetVertexLoaderString(std::string id, DebugShaderStringType stringType);
|
||||||
|
|
||||||
void Resized();
|
virtual void Resized();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void ClearTrackedVertexArrays() {}
|
virtual void ClearTrackedVertexArrays() {}
|
||||||
|
|
|
@ -133,15 +133,24 @@ void DrawEngineD3D11::ClearTrackedVertexArrays() {
|
||||||
vai_.clear();
|
vai_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawEngineD3D11::DestroyDeviceObjects() {
|
void DrawEngineD3D11::ClearInputLayoutMap() {
|
||||||
ClearTrackedVertexArrays();
|
|
||||||
delete tessDataTransfer;
|
|
||||||
delete pushVerts_;
|
|
||||||
delete pushInds_;
|
|
||||||
|
|
||||||
for (auto &decl : inputLayoutMap_) {
|
for (auto &decl : inputLayoutMap_) {
|
||||||
decl.second->Release();
|
decl.second->Release();
|
||||||
}
|
}
|
||||||
|
inputLayoutMap_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawEngineD3D11::Resized() {
|
||||||
|
DrawEngineCommon::Resized();
|
||||||
|
ClearInputLayoutMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawEngineD3D11::DestroyDeviceObjects() {
|
||||||
|
ClearTrackedVertexArrays();
|
||||||
|
ClearInputLayoutMap();
|
||||||
|
delete tessDataTransfer;
|
||||||
|
delete pushVerts_;
|
||||||
|
delete pushInds_;
|
||||||
for (auto &depth : depthStencilCache_) {
|
for (auto &depth : depthStencilCache_) {
|
||||||
depth.second->Release();
|
depth.second->Release();
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,6 +155,8 @@ public:
|
||||||
|
|
||||||
void ClearTrackedVertexArrays() override;
|
void ClearTrackedVertexArrays() override;
|
||||||
|
|
||||||
|
void Resized() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DecodeVerts();
|
void DecodeVerts();
|
||||||
void DecodeVertsStep();
|
void DecodeVertsStep();
|
||||||
|
@ -164,6 +166,8 @@ private:
|
||||||
void ApplyDrawStateLate(bool applyStencilRef, uint8_t stencilRef);
|
void ApplyDrawStateLate(bool applyStencilRef, uint8_t stencilRef);
|
||||||
void ResetShaderBlending();
|
void ResetShaderBlending();
|
||||||
|
|
||||||
|
void ClearInputLayoutMap();
|
||||||
|
|
||||||
ID3D11InputLayout *SetupDecFmtForDraw(D3D11VertexShader *vshader, const DecVtxFormat &decFmt, u32 pspFmt);
|
ID3D11InputLayout *SetupDecFmtForDraw(D3D11VertexShader *vshader, const DecVtxFormat &decFmt, u32 pspFmt);
|
||||||
|
|
||||||
u32 ComputeMiniHash();
|
u32 ComputeMiniHash();
|
||||||
|
|
|
@ -300,6 +300,12 @@ void GPU_D3D11::DumpNextFrame() {
|
||||||
void GPU_D3D11::BeginHostFrame() {
|
void GPU_D3D11::BeginHostFrame() {
|
||||||
GPUCommon::BeginHostFrame();
|
GPUCommon::BeginHostFrame();
|
||||||
UpdateCmdInfo();
|
UpdateCmdInfo();
|
||||||
|
if (resized_) {
|
||||||
|
drawEngine_.Resized();
|
||||||
|
textureCacheD3D11_->NotifyConfigChanged();
|
||||||
|
shaderManagerD3D11_->DirtyShader();
|
||||||
|
resized_ = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_D3D11::BeginFrame() {
|
void GPU_D3D11::BeginFrame() {
|
||||||
|
@ -319,12 +325,6 @@ void GPU_D3D11::EndHostFrame() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_D3D11::BeginFrameInternal() {
|
void GPU_D3D11::BeginFrameInternal() {
|
||||||
if (resized_) {
|
|
||||||
drawEngine_.Resized();
|
|
||||||
textureCacheD3D11_->NotifyConfigChanged();
|
|
||||||
resized_ = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
textureCacheD3D11_->StartFrame();
|
textureCacheD3D11_->StartFrame();
|
||||||
drawEngine_.BeginFrame();
|
drawEngine_.BeginFrame();
|
||||||
depalShaderCache_->Decimate();
|
depalShaderCache_->Decimate();
|
||||||
|
|
|
@ -267,6 +267,12 @@ void GPU_DX9::DumpNextFrame() {
|
||||||
void GPU_DX9::BeginHostFrame() {
|
void GPU_DX9::BeginHostFrame() {
|
||||||
GPUCommon::BeginHostFrame();
|
GPUCommon::BeginHostFrame();
|
||||||
UpdateCmdInfo();
|
UpdateCmdInfo();
|
||||||
|
if (resized_) {
|
||||||
|
drawEngine_.Resized();
|
||||||
|
shaderManagerDX9_->DirtyShader();
|
||||||
|
textureCacheDX9_->NotifyConfigChanged();
|
||||||
|
resized_ = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_DX9::BeginFrame() {
|
void GPU_DX9::BeginFrame() {
|
||||||
|
@ -279,12 +285,6 @@ void GPU_DX9::ReapplyGfxStateInternal() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_DX9::BeginFrameInternal() {
|
void GPU_DX9::BeginFrameInternal() {
|
||||||
if (resized_) {
|
|
||||||
drawEngine_.Resized();
|
|
||||||
textureCacheDX9_->NotifyConfigChanged();
|
|
||||||
resized_ = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Turn off vsync when unthrottled
|
// Turn off vsync when unthrottled
|
||||||
int desiredVSyncInterval = g_Config.bVSync ? 1 : 0;
|
int desiredVSyncInterval = g_Config.bVSync ? 1 : 0;
|
||||||
if ((PSP_CoreParameter().unthrottle) || (PSP_CoreParameter().fpsLimit == 1))
|
if ((PSP_CoreParameter().unthrottle) || (PSP_CoreParameter().fpsLimit == 1))
|
||||||
|
|
|
@ -426,6 +426,12 @@ void GPU_GLES::DumpNextFrame() {
|
||||||
void GPU_GLES::BeginHostFrame() {
|
void GPU_GLES::BeginHostFrame() {
|
||||||
GPUCommon::BeginHostFrame();
|
GPUCommon::BeginHostFrame();
|
||||||
UpdateCmdInfo();
|
UpdateCmdInfo();
|
||||||
|
if (resized_) {
|
||||||
|
CheckGPUFeatures();
|
||||||
|
drawEngine_.Resized();
|
||||||
|
shaderManagerGL_->DirtyShader();
|
||||||
|
textureCacheGL_->NotifyConfigChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_GLES::BeginFrame() {
|
void GPU_GLES::BeginFrame() {
|
||||||
|
@ -476,11 +482,6 @@ void GPU_GLES::ReapplyGfxStateInternal() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_GLES::BeginFrameInternal() {
|
void GPU_GLES::BeginFrameInternal() {
|
||||||
if (resized_) {
|
|
||||||
CheckGPUFeatures();
|
|
||||||
drawEngine_.Resized();
|
|
||||||
textureCacheGL_->NotifyConfigChanged();
|
|
||||||
}
|
|
||||||
UpdateVsyncInterval(resized_);
|
UpdateVsyncInterval(resized_);
|
||||||
resized_ = false;
|
resized_ = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue