Permalink
Browse files

Merge pull request #10088 from unknownbrackets/d3d11-savestate

Avoid clearing shaders on load state
  • Loading branch information...
hrydgard committed Nov 11, 2017
2 parents 74a8aa5 + 7041341 commit 83e1cfb2839b8bde8efdc25e578cc128d1190417
@@ -301,7 +301,9 @@ class Module : public KernelObject {
} else {
// Older save state. Let's still reload, but this may not pick up new flags, etc.
bool foundBroken = false;
for (auto func : importedFuncs) {
auto importedFuncsState = importedFuncs;
importedFuncs.clear();
for (auto func : importedFuncsState) {
if (func.moduleName[KERNELOBJECT_MAX_NAME_LENGTH] != '\0' || !Memory::IsValidAddress(func.stubAddr)) {
foundBroken = true;
} else {
@@ -146,6 +146,8 @@ class DrawEngineD3D11 : public DrawEngineCommon {
void Resized() override;
void ClearInputLayoutMap();
private:
void DecodeVerts();
void DoFlush();
@@ -154,8 +156,6 @@ class DrawEngineD3D11 : public DrawEngineCommon {
void ApplyDrawStateLate(bool applyStencilRef, uint8_t stencilRef);
void ResetShaderBlending();
void ClearInputLayoutMap();
ID3D11InputLayout *SetupDecFmtForDraw(D3D11VertexShader *vshader, const DecVtxFormat &decFmt, u32 pspFmt);
void MarkUnreliable(VertexArrayInfoD3D11 *vai);
View
@@ -278,6 +278,7 @@ void GPU_D3D11::DeviceLost() {
// Simply drop all caches and textures.
// FBOs appear to survive? Or no?
shaderManagerD3D11_->ClearShaders();
drawEngine_.ClearInputLayoutMap();
textureCacheD3D11_->Clear(false);
framebufferManagerD3D11_->DeviceLost();
}
@@ -742,20 +743,20 @@ void GPU_D3D11::ClearCacheNextFrame() {
void GPU_D3D11::ClearShaderCache() {
shaderManagerD3D11_->ClearShaders();
drawEngine_.ClearInputLayoutMap();
}
void GPU_D3D11::DoState(PointerWrap &p) {
GPUCommon::DoState(p);
// TODO: Some of these things may not be necessary.
// None of these are necessary when saving.
if (p.mode == p.MODE_READ) {
if (p.mode == p.MODE_READ && !PSP_CoreParameter().frozen) {
textureCacheD3D11_->Clear(true);
drawEngine_.ClearTrackedVertexArrays();
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
framebufferManagerD3D11_->DestroyAllFBOs();
shaderManagerD3D11_->ClearShaders();
}
}
View
@@ -681,13 +681,12 @@ void GPU_DX9::DoState(PointerWrap &p) {
// TODO: Some of these things may not be necessary.
// None of these are necessary when saving.
if (p.mode == p.MODE_READ) {
if (p.mode == p.MODE_READ && !PSP_CoreParameter().frozen) {
textureCacheDX9_->Clear(true);
drawEngine_.ClearTrackedVertexArrays();
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
framebufferManagerDX9_->DestroyAllFBOs();
shaderManagerDX9_->ClearCache(true);
}
}
View
@@ -930,12 +930,10 @@ void GPU_GLES::DoState(PointerWrap &p) {
// In Freeze-Frame mode, we don't want to do any of this.
if (p.mode == p.MODE_READ && !PSP_CoreParameter().frozen) {
textureCacheGL_->Clear(true);
depalShaderCache_.Clear();
drawEngine_.ClearTrackedVertexArrays();
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
framebufferManagerGL_->DestroyAllFBOs();
shaderManagerGL_->ClearCache(true);
}
}
@@ -897,8 +897,6 @@ void GPU_Vulkan::DoState(PointerWrap &p) {
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
framebufferManagerVulkan_->DestroyAllFBOs();
shaderManagerVulkan_->ClearShaders();
pipelineManager_->Clear();
}
}

0 comments on commit 83e1cfb

Please sign in to comment.