Some slight unification

This commit is contained in:
Henrik Rydgård 2023-02-25 15:07:00 +01:00
parent b6846646af
commit e136ad795a
9 changed files with 19 additions and 25 deletions

View file

@ -116,14 +116,6 @@ u32 GPU_D3D11::CheckGPUFeatures() const {
return CheckGPUFeaturesLate(features);
}
// Needs to be called on GPU thread, not reporting thread.
void GPU_D3D11::BuildReportingInfo() {
using namespace Draw;
reportingPrimaryInfo_ = draw_->GetInfoString(InfoField::VENDORSTRING);
reportingFullInfo_ = reportingPrimaryInfo_ + " - " + System_GetProperty(SYSPROP_GPUDRIVER_VERSION) + " - " + draw_->GetInfoString(InfoField::SHADELANGVERSION);
}
void GPU_D3D11::DeviceLost() {
draw_->Invalidate(InvalidationFlags::CACHED_RENDER_STATE);
// Simply drop all caches and textures.

View file

@ -48,8 +48,6 @@ protected:
void FinishDeferred() override;
private:
void BuildReportingInfo() override;
void InitClear() override;
void BeginFrame() override;

View file

@ -113,13 +113,6 @@ GPU_DX9::~GPU_DX9() {
delete shaderManagerDX9_;
}
// Needs to be called on GPU thread, not reporting thread.
void GPU_DX9::BuildReportingInfo() {
using namespace Draw;
reportingPrimaryInfo_ = draw_->GetInfoString(InfoField::VENDORSTRING);
reportingFullInfo_ = reportingPrimaryInfo_ + " - " + System_GetProperty(SYSPROP_GPUDRIVER_VERSION) + " - " + draw_->GetInfoString(InfoField::SHADELANGVERSION);
}
void GPU_DX9::DeviceLost() {
// Simply drop all caches and textures.
shaderManagerDX9_->ClearCache(false);

View file

@ -50,8 +50,6 @@ protected:
void FinishDeferred() override;
private:
void BuildReportingInfo() override;
void InitClear() override;
void BeginFrame() override;

View file

@ -633,10 +633,6 @@ void GPUCommon::NotifyDisplayResized() {
displayResized_ = true;
}
void GPUCommon::ClearCacheNextFrame() {
textureCache_->ClearNextFrame();
}
// Called once per frame. Might also get called during the pause screen
// if "transparent".
void GPUCommon::CheckConfigChanged() {

View file

@ -272,7 +272,7 @@ protected:
void DeviceLost() override;
void DeviceRestore() override;
void ClearCacheNextFrame() override;
void ClearCacheNextFrame() override {}
virtual void CheckRenderResized();
@ -332,9 +332,11 @@ protected:
DrawEngineCommon *drawEngineCommon_ = nullptr;
// TODO: These should live in GPUCommonHW.
FramebufferManagerCommon *framebufferManager_ = nullptr;
TextureCacheCommon *textureCache_ = nullptr;
ShaderManagerCommon *shaderManager_ = nullptr;
bool flushOnParams_ = true;
GraphicsContext *gfxCtx_;

View file

@ -1,5 +1,6 @@
#include "Common/GPU/thin3d.h"
#include "Common/Serialize/Serializer.h"
#include "Common/System/System.h"
#include "Core/System.h"
@ -39,3 +40,15 @@ void GPUCommonHW::DoState(PointerWrap &p) {
framebufferManager_->DestroyAllFBOs();
}
}
void GPUCommonHW::ClearCacheNextFrame() {
textureCache_->ClearNextFrame();
}
// Needs to be called on GPU thread, not reporting thread.
void GPUCommonHW::BuildReportingInfo() {
using namespace Draw;
reportingPrimaryInfo_ = draw_->GetInfoString(InfoField::VENDORSTRING);
reportingFullInfo_ = reportingPrimaryInfo_ + " - " + System_GetProperty(SYSPROP_GPUDRIVER_VERSION) + " - " + draw_->GetInfoString(InfoField::SHADELANGVERSION);
}

View file

@ -14,6 +14,9 @@ public:
protected:
void PreExecuteOp(u32 op, u32 diff);
void ClearCacheNextFrame() override;
// Needs to be called on GPU thread, not reporting thread.
void BuildReportingInfo() override;
};

View file

@ -145,7 +145,6 @@ public:
bool PerformReadbackToMemory(u32 dest, int size) override;
bool PerformWriteColorFromMemory(u32 dest, int size) override;
bool PerformWriteStencilFromMemory(u32 dest, int size, WriteStencil flags) override;
void ClearCacheNextFrame() override {}
void DeviceLost() override;
void DeviceRestore() override;