2023-02-25 13:24:59 +00:00
|
|
|
#include "Common/GPU/thin3d.h"
|
2023-02-25 13:34:30 +00:00
|
|
|
#include "Common/Serialize/Serializer.h"
|
2023-02-25 14:07:00 +00:00
|
|
|
#include "Common/System/System.h"
|
2023-02-25 13:34:30 +00:00
|
|
|
|
|
|
|
#include "Core/System.h"
|
|
|
|
|
2023-02-25 13:24:59 +00:00
|
|
|
#include "GPU/GPUCommonHW.h"
|
2023-02-25 13:28:22 +00:00
|
|
|
#include "GPU/Common/DrawEngineCommon.h"
|
2023-02-25 13:34:30 +00:00
|
|
|
#include "GPU/Common/TextureCacheCommon.h"
|
2023-02-25 13:28:22 +00:00
|
|
|
#include "GPU/Common/FramebufferManagerCommon.h"
|
2023-02-25 13:24:59 +00:00
|
|
|
|
2023-02-25 13:34:30 +00:00
|
|
|
GPUCommonHW::GPUCommonHW(GraphicsContext *gfxCtx, Draw::DrawContext *draw) : GPUCommon(gfxCtx, draw) {}
|
2023-02-25 13:24:59 +00:00
|
|
|
GPUCommonHW::~GPUCommonHW() {}
|
|
|
|
|
|
|
|
void GPUCommonHW::PreExecuteOp(u32 op, u32 diff) {
|
|
|
|
CheckFlushOp(op >> 24, diff);
|
|
|
|
}
|
2023-02-25 13:28:22 +00:00
|
|
|
|
|
|
|
void GPUCommonHW::CopyDisplayToOutput(bool reallyDirty) {
|
|
|
|
// Flush anything left over.
|
|
|
|
drawEngineCommon_->DispatchFlush();
|
|
|
|
|
|
|
|
shaderManager_->DirtyLastShader();
|
|
|
|
|
|
|
|
framebufferManager_->CopyDisplayToOutput(reallyDirty);
|
|
|
|
|
|
|
|
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
|
|
|
|
}
|
2023-02-25 13:34:30 +00:00
|
|
|
|
|
|
|
void GPUCommonHW::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 && !PSP_CoreParameter().frozen) {
|
|
|
|
textureCache_->Clear(true);
|
|
|
|
drawEngineCommon_->ClearTrackedVertexArrays();
|
|
|
|
|
|
|
|
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
|
|
|
|
framebufferManager_->DestroyAllFBOs();
|
|
|
|
}
|
|
|
|
}
|
2023-02-25 14:07:00 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|