mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #15895 from unknownbrackets/gpu-minor
GPU: Correct Draw2D::DeviceRestore()
This commit is contained in:
commit
586da08820
12 changed files with 19 additions and 3 deletions
|
@ -144,10 +144,11 @@ void Draw2D::DeviceLost() {
|
|||
DoRelease(draw2DVs_);
|
||||
DoRelease(draw2DSamplerLinear_);
|
||||
DoRelease(draw2DSamplerNearest_);
|
||||
draw_ = nullptr;
|
||||
}
|
||||
|
||||
void Draw2D::DeviceRestore(Draw::DrawContext *draw) {
|
||||
|
||||
draw_ = draw;
|
||||
}
|
||||
|
||||
void Draw2D::Ensure2DResources() {
|
||||
|
|
|
@ -2439,7 +2439,7 @@ void FramebufferManagerCommon::DeviceLost() {
|
|||
void FramebufferManagerCommon::DeviceRestore(Draw::DrawContext *draw) {
|
||||
draw_ = draw;
|
||||
draw2D_.DeviceRestore(draw_);
|
||||
presentation_->DeviceRestore(draw);
|
||||
presentation_->DeviceRestore(draw_);
|
||||
}
|
||||
|
||||
void FramebufferManagerCommon::DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, int flags) {
|
||||
|
|
|
@ -393,6 +393,7 @@ void PresentationCommon::ShowPostShaderError(const std::string &errorString) {
|
|||
|
||||
void PresentationCommon::DeviceLost() {
|
||||
DestroyDeviceObjects();
|
||||
draw_ = nullptr;
|
||||
}
|
||||
|
||||
void PresentationCommon::DeviceRestore(Draw::DrawContext *draw) {
|
||||
|
|
|
@ -50,6 +50,7 @@ void TextureShaderCache::DeviceRestore(Draw::DrawContext *draw) {
|
|||
|
||||
void TextureShaderCache::DeviceLost() {
|
||||
Clear();
|
||||
draw_ = nullptr;
|
||||
}
|
||||
|
||||
ClutTexture TextureShaderCache::GetClutTexture(GEPaletteFormat clutFormat, const u32 clutHash, u32 *rawClut) {
|
||||
|
|
|
@ -91,6 +91,8 @@ DrawEngineGLES::~DrawEngineGLES() {
|
|||
|
||||
void DrawEngineGLES::DeviceLost() {
|
||||
DestroyDeviceObjects();
|
||||
draw_ = nullptr;
|
||||
render_ = nullptr;
|
||||
}
|
||||
|
||||
void DrawEngineGLES::DeviceRestore(Draw::DrawContext *draw) {
|
||||
|
|
|
@ -69,6 +69,7 @@ public:
|
|||
|
||||
void DeviceLost() {
|
||||
Clear(false);
|
||||
render_ = nullptr;
|
||||
}
|
||||
void DeviceRestore(Draw::DrawContext *draw);
|
||||
void Clear(bool deleteThem = true);
|
||||
|
|
|
@ -617,6 +617,8 @@ void ShaderManagerGLES::ClearCache(bool deleteThem) {
|
|||
|
||||
void ShaderManagerGLES::DeviceLost() {
|
||||
Clear();
|
||||
render_ = nullptr;
|
||||
draw_ = nullptr;
|
||||
}
|
||||
|
||||
void ShaderManagerGLES::DeviceRestore(Draw::DrawContext *draw) {
|
||||
|
|
|
@ -528,7 +528,7 @@ void GPU_Vulkan::DeviceLost() {
|
|||
drawEngine_.DeviceLost();
|
||||
pipelineManager_->DeviceLost();
|
||||
textureCacheVulkan_->DeviceLost();
|
||||
shaderManagerVulkan_->ClearShaders();
|
||||
shaderManagerVulkan_->DeviceLost();
|
||||
|
||||
GPUCommon::DeviceLost();
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ PipelineManagerVulkan::~PipelineManagerVulkan() {
|
|||
Clear();
|
||||
if (pipelineCache_ != VK_NULL_HANDLE)
|
||||
vulkan_->Delete().QueueDeletePipelineCache(pipelineCache_);
|
||||
vulkan_ = nullptr;
|
||||
}
|
||||
|
||||
void PipelineManagerVulkan::Clear() {
|
||||
|
@ -55,6 +56,7 @@ void PipelineManagerVulkan::DeviceLost() {
|
|||
Clear();
|
||||
if (pipelineCache_ != VK_NULL_HANDLE)
|
||||
vulkan_->Delete().QueueDeletePipelineCache(pipelineCache_);
|
||||
vulkan_ = nullptr;
|
||||
}
|
||||
|
||||
void PipelineManagerVulkan::DeviceRestore(VulkanContext *vulkan) {
|
||||
|
|
|
@ -160,6 +160,10 @@ ShaderManagerVulkan::~ShaderManagerVulkan() {
|
|||
delete[] codeBuffer_;
|
||||
}
|
||||
|
||||
void ShaderManagerVulkan::DeviceLost() {
|
||||
draw_ = nullptr;
|
||||
}
|
||||
|
||||
void ShaderManagerVulkan::DeviceRestore(Draw::DrawContext *draw) {
|
||||
VulkanContext *vulkan = (VulkanContext *)draw->GetNativeObject(Draw::NativeObject::CONTEXT);
|
||||
draw_ = draw;
|
||||
|
|
|
@ -86,6 +86,7 @@ public:
|
|||
ShaderManagerVulkan(Draw::DrawContext *draw);
|
||||
~ShaderManagerVulkan();
|
||||
|
||||
void DeviceLost();
|
||||
void DeviceRestore(Draw::DrawContext *draw);
|
||||
|
||||
void GetShaders(int prim, u32 vertType, VulkanVertexShader **vshader, VulkanFragmentShader **fshader, bool useHWTransform, bool useHWTessellation, bool weightsAsFloat);
|
||||
|
|
|
@ -168,6 +168,7 @@ void SamplerCache::DeviceLost() {
|
|||
vulkan_->Delete().QueueDeleteSampler(sampler);
|
||||
});
|
||||
cache_.Clear();
|
||||
vulkan_ = nullptr;
|
||||
}
|
||||
|
||||
void SamplerCache::DeviceRestore(VulkanContext *vulkan) {
|
||||
|
|
Loading…
Add table
Reference in a new issue