Pass in draw directly in GPUCommon::DeviceRestore, instead of awkwardly fetching it

This commit is contained in:
Henrik Rydgård committed 2023-02-25 23:04:27 +01:00
1 parent 3e942f6b7b
commit 4c45f8a4b0
16 files changed
+26 -26

No files matched your search

+2 -2
View File
@@ -122,8 +122,8 @@ void GPU_D3D11::DeviceLost() {
GPUCommonHW::DeviceLost();
}
void GPU_D3D11::DeviceRestore() {
GPUCommonHW::DeviceRestore();
void GPU_D3D11::DeviceRestore(Draw::DrawContext *draw) {
GPUCommonHW::DeviceRestore(draw);
// Nothing needed.
}
+1 -1
View File
@@ -38,7 +38,7 @@ public:
void GetStats(char *buffer, size_t bufsize) override;
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
void DeviceRestore() override;
void DeviceRestore(Draw::DrawContext *draw) override;
protected:
void FinishDeferred() override;
+2 -2
View File
@@ -244,8 +244,8 @@ void GPU_GLES::DeviceLost() {
GPUCommonHW::DeviceLost();
}
void GPU_GLES::DeviceRestore() {
GPUCommonHW::DeviceRestore();
void GPU_GLES::DeviceRestore(Draw::DrawContext *draw) {
GPUCommonHW::DeviceRestore(draw);
UpdateCmdInfo();
UpdateVsyncInterval(true);
+1 -1
View File
@@ -46,7 +46,7 @@ public:
void GetStats(char *buffer, size_t bufsize) override;
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
void DeviceRestore() override;
void DeviceRestore(Draw::DrawContext *draw) override;
void BeginHostFrame() override;
void EndHostFrame() override;
+2 -6
View File
@@ -133,8 +133,8 @@ void GPUCommon::DeviceLost() {
}
// Call at the start of the GPU implementation's DeviceRestore
void GPUCommon::DeviceRestore() {
draw_ = (Draw::DrawContext *)PSP_CoreParameter().graphicsContext->GetDrawContext();
void GPUCommon::DeviceRestore(Draw::DrawContext *draw) {
draw_ = draw;
framebufferManager_->DeviceRestore(draw_);
PPGeSetDrawContext(draw_);
}
@@ -2026,10 +2026,6 @@ bool GPUCommon::PerformWriteStencilFromMemory(u32 dest, int size, WriteStencil f
return false;
}
std::vector<FramebufferInfo> GPUCommon::GetFramebufferList() const {
return framebufferManager_->GetFramebufferList();
}
bool GPUCommon::GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices) {
UpdateUVScaleOffset();
return drawEngineCommon_->GetCurrentSimpleVertices(count, vertices, indices);
+1 -2
View File
@@ -211,7 +211,6 @@ public:
const std::list<int>& GetDisplayLists() override {
return dlQueue;
}
std::vector<FramebufferInfo> GetFramebufferList() const override;
s64 GetListTicks(int listid) const override {
if (listid >= 0 && listid < DisplayListMaxCount) {
@@ -227,7 +226,7 @@ public:
protected:
void DeviceLost() override;
void DeviceRestore() override;
void DeviceRestore(Draw::DrawContext *draw) override;
void ClearCacheNextFrame() override {}
+4
View File
@@ -678,6 +678,10 @@ bool GPUCommonHW::GetOutputFramebuffer(GPUDebugBuffer &buffer) {
return framebufferManager_ ? framebufferManager_->GetOutputFramebuffer(buffer) : false;
}
std::vector<FramebufferInfo> GPUCommonHW::GetFramebufferList() const {
return framebufferManager_->GetFramebufferList();
}
bool GPUCommonHW::GetCurrentClut(GPUDebugBuffer &buffer) {
return textureCache_->GetCurrentClutBuffer(buffer);
}
+1
View File
@@ -22,6 +22,7 @@ public:
bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override;
bool GetOutputFramebuffer(GPUDebugBuffer &buffer) override;
std::vector<FramebufferInfo> GetFramebufferList() const override;
bool GetCurrentTexture(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override;
bool GetCurrentClut(GPUDebugBuffer &buffer) override;
+1 -1
View File
@@ -251,7 +251,7 @@ public:
virtual void EnableInterrupts(bool enable) = 0;
virtual void DeviceLost() = 0;
virtual void DeviceRestore() = 0;
virtual void DeviceRestore(Draw::DrawContext *draw) = 0;
virtual void ReapplyGfxState() = 0;
virtual void DoState(PointerWrap &p) = 0;
+2 -3
View File
@@ -466,9 +466,8 @@ void SoftGPU::DeviceLost() {
}
}
void SoftGPU::DeviceRestore() {
if (PSP_CoreParameter().graphicsContext)
draw_ = (Draw::DrawContext *)PSP_CoreParameter().graphicsContext->GetDrawContext();
void SoftGPU::DeviceRestore(Draw::DrawContext *draw) {
draw_ = draw;
if (presentation_)
presentation_->DeviceRestore(draw_);
PPGeSetDrawContext(draw_);
+2 -1
View File
@@ -138,6 +138,7 @@ public:
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
void CopyDisplayToOutput(bool reallyDirty) override;
void GetStats(char *buffer, size_t bufsize) override;
std::vector<FramebufferInfo> GetFramebufferList() const override { return std::vector<FramebufferInfo>(); }
void InvalidateCache(u32 addr, int size, GPUInvalidationType type) override;
void PerformWriteFormattedFromMemory(u32 addr, int size, int width, GEBufferFormat format) override;
bool PerformMemoryCopy(u32 dest, u32 src, int size, GPUCopyFlag flags = GPUCopyFlag::NONE) override;
@@ -147,7 +148,7 @@ public:
bool PerformWriteStencilFromMemory(u32 dest, int size, WriteStencil flags) override;
void DeviceLost() override;
void DeviceRestore() override;
void DeviceRestore(Draw::DrawContext *draw) override;
void NotifyRenderResized() override;
void NotifyDisplayResized() override;
+2 -2
View File
@@ -460,8 +460,8 @@ void GPU_Vulkan::DeviceLost() {
GPUCommonHW::DeviceLost();
}
void GPU_Vulkan::DeviceRestore() {
GPUCommonHW::DeviceRestore();
void GPU_Vulkan::DeviceRestore(Draw::DrawContext *draw) {
GPUCommonHW::DeviceRestore(draw);
InitDeviceObjects();
gstate_c.SetUseFlags(CheckGPUFeatures());
+1 -1
View File
@@ -49,7 +49,7 @@ public:
void GetStats(char *buffer, size_t bufsize) override;
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
void DeviceRestore() override;
void DeviceRestore(Draw::DrawContext *draw) override;
// Using string because it's generic - makes no assumptions on the size of the shader IDs of this backend.
std::vector<std::string> DebugGetShaderIDs(DebugShaderType shader) override;
+2 -2
View File
@@ -59,8 +59,8 @@ public:
void StartFrame() override;
void DeviceLost();
void DeviceRestore(Draw::DrawContext *draw);
void DeviceLost() override;
void DeviceRestore(Draw::DrawContext *draw) override;
void SetFramebufferManager(FramebufferManagerVulkan *fbManager);
void SetDrawEngine(DrawEngineVulkan *td) {
+1 -1
View File
@@ -914,7 +914,7 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
g_gameInfoCache = new GameInfoCache();
if (gpu) {
gpu->DeviceRestore();
gpu->DeviceRestore(g_draw);
}
INFO_LOG(SYSTEM, "NativeInitGraphics completed");
+1 -1
View File
@@ -58,7 +58,7 @@ void LibretroHWRenderContext::ContextReset() {
GotBackbuffer();
if (gpu) {
gpu->DeviceRestore();
gpu->DeviceRestore(draw_);
}
}