Get rid of GPUCommon's "Internal" functions.
This commit is contained in:
parent
bb68906d88
commit
8c69be9bfa
12 changed files with 59 additions and 123 deletions
|
@ -286,7 +286,7 @@ void GPU_D3D11::DeviceRestore() {
|
||||||
// Nothing needed.
|
// Nothing needed.
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_D3D11::InitClearInternal() {
|
void GPU_D3D11::InitClear() {
|
||||||
bool useNonBufferedRendering = g_Config.iRenderingMode == FB_NON_BUFFERED_MODE;
|
bool useNonBufferedRendering = g_Config.iRenderingMode == FB_NON_BUFFERED_MODE;
|
||||||
if (useNonBufferedRendering) {
|
if (useNonBufferedRendering) {
|
||||||
// device_->Clear(0, NULL, D3DCLEAR_STENCIL | D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.f, 0);
|
// device_->Clear(0, NULL, D3DCLEAR_STENCIL | D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.f, 0);
|
||||||
|
@ -305,8 +305,8 @@ void GPU_D3D11::BeginHostFrame() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_D3D11::ReapplyGfxStateInternal() {
|
void GPU_D3D11::ReapplyGfxState() {
|
||||||
GPUCommon::ReapplyGfxStateInternal();
|
GPUCommon::ReapplyGfxState();
|
||||||
|
|
||||||
// TODO: Dirty our caches for depth states etc
|
// TODO: Dirty our caches for depth states etc
|
||||||
}
|
}
|
||||||
|
@ -316,8 +316,8 @@ void GPU_D3D11::EndHostFrame() {
|
||||||
draw_->BindPipeline(nullptr);
|
draw_->BindPipeline(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_D3D11::BeginFrameInternal() {
|
void GPU_D3D11::BeginFrame() {
|
||||||
GPUCommon::BeginFrameInternal();
|
GPUCommon::BeginFrame();
|
||||||
|
|
||||||
textureCacheD3D11_->StartFrame();
|
textureCacheD3D11_->StartFrame();
|
||||||
drawEngine_.BeginFrame();
|
drawEngine_.BeginFrame();
|
||||||
|
@ -357,7 +357,7 @@ bool GPU_D3D11::FramebufferReallyDirty() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_D3D11::CopyDisplayToOutputInternal() {
|
void GPU_D3D11::CopyDisplayToOutput() {
|
||||||
float blendColor[4]{};
|
float blendColor[4]{};
|
||||||
context_->OMSetBlendState(stockD3D11.blendStateDisabledWithColorMask[0xF], blendColor, 0xFFFFFFFF);
|
context_->OMSetBlendState(stockD3D11.blendStateDisabledWithColorMask[0xF], blendColor, 0xFFFFFFFF);
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
void PreExecuteOp(u32 op, u32 diff) override;
|
void PreExecuteOp(u32 op, u32 diff) override;
|
||||||
void ExecuteOp(u32 op, u32 diff) override;
|
void ExecuteOp(u32 op, u32 diff) override;
|
||||||
|
|
||||||
void ReapplyGfxStateInternal() override;
|
void ReapplyGfxState() override;
|
||||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||||
void GetStats(char *buffer, size_t bufsize) override;
|
void GetStats(char *buffer, size_t bufsize) override;
|
||||||
void ClearCacheNextFrame() override;
|
void ClearCacheNextFrame() override;
|
||||||
|
@ -96,9 +96,9 @@ private:
|
||||||
void CheckFlushOp(int cmd, u32 diff);
|
void CheckFlushOp(int cmd, u32 diff);
|
||||||
void BuildReportingInfo();
|
void BuildReportingInfo();
|
||||||
|
|
||||||
void InitClearInternal() override;
|
void InitClear() override;
|
||||||
void BeginFrameInternal() override;
|
void BeginFrame() override;
|
||||||
void CopyDisplayToOutputInternal() override;
|
void CopyDisplayToOutput() override;
|
||||||
|
|
||||||
ID3D11Device *device_;
|
ID3D11Device *device_;
|
||||||
ID3D11DeviceContext *context_;
|
ID3D11DeviceContext *context_;
|
||||||
|
|
|
@ -251,7 +251,7 @@ void GPU_DX9::DeviceRestore() {
|
||||||
// Nothing needed.
|
// Nothing needed.
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_DX9::InitClearInternal() {
|
void GPU_DX9::InitClear() {
|
||||||
bool useNonBufferedRendering = g_Config.iRenderingMode == FB_NON_BUFFERED_MODE;
|
bool useNonBufferedRendering = g_Config.iRenderingMode == FB_NON_BUFFERED_MODE;
|
||||||
if (useNonBufferedRendering) {
|
if (useNonBufferedRendering) {
|
||||||
dxstate.depthWrite.set(true);
|
dxstate.depthWrite.set(true);
|
||||||
|
@ -272,12 +272,12 @@ void GPU_DX9::BeginHostFrame() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_DX9::ReapplyGfxStateInternal() {
|
void GPU_DX9::ReapplyGfxState() {
|
||||||
dxstate.Restore();
|
dxstate.Restore();
|
||||||
GPUCommon::ReapplyGfxStateInternal();
|
GPUCommon::ReapplyGfxState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_DX9::BeginFrameInternal() {
|
void GPU_DX9::BeginFrame() {
|
||||||
// Turn off vsync when unthrottled
|
// Turn off vsync when unthrottled
|
||||||
int desiredVSyncInterval = g_Config.bVSync ? 1 : 0;
|
int desiredVSyncInterval = g_Config.bVSync ? 1 : 0;
|
||||||
if ((PSP_CoreParameter().unthrottle) || (PSP_CoreParameter().fpsLimit == 1))
|
if ((PSP_CoreParameter().unthrottle) || (PSP_CoreParameter().fpsLimit == 1))
|
||||||
|
@ -292,7 +292,7 @@ void GPU_DX9::BeginFrameInternal() {
|
||||||
depalShaderCache_.Decimate();
|
depalShaderCache_.Decimate();
|
||||||
// fragmentTestCache_.Decimate();
|
// fragmentTestCache_.Decimate();
|
||||||
|
|
||||||
GPUCommon::BeginFrameInternal();
|
GPUCommon::BeginFrame();
|
||||||
shaderManagerDX9_->DirtyShader();
|
shaderManagerDX9_->DirtyShader();
|
||||||
|
|
||||||
framebufferManager_->BeginFrame();
|
framebufferManager_->BeginFrame();
|
||||||
|
@ -323,7 +323,7 @@ bool GPU_DX9::FramebufferReallyDirty() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_DX9::CopyDisplayToOutputInternal() {
|
void GPU_DX9::CopyDisplayToOutput() {
|
||||||
dxstate.depthWrite.set(true);
|
dxstate.depthWrite.set(true);
|
||||||
dxstate.colorMask.set(true, true, true, true);
|
dxstate.colorMask.set(true, true, true, true);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
void PreExecuteOp(u32 op, u32 diff) override;
|
void PreExecuteOp(u32 op, u32 diff) override;
|
||||||
void ExecuteOp(u32 op, u32 diff) override;
|
void ExecuteOp(u32 op, u32 diff) override;
|
||||||
|
|
||||||
void ReapplyGfxStateInternal() override;
|
void ReapplyGfxState() override;
|
||||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||||
void GetStats(char *buffer, size_t bufsize) override;
|
void GetStats(char *buffer, size_t bufsize) override;
|
||||||
void ClearCacheNextFrame() override;
|
void ClearCacheNextFrame() override;
|
||||||
|
@ -96,9 +96,9 @@ private:
|
||||||
void CheckFlushOp(int cmd, u32 diff);
|
void CheckFlushOp(int cmd, u32 diff);
|
||||||
void BuildReportingInfo();
|
void BuildReportingInfo();
|
||||||
|
|
||||||
void InitClearInternal() override;
|
void InitClear() override;
|
||||||
void BeginFrameInternal() override;
|
void BeginFrame() override;
|
||||||
void CopyDisplayToOutputInternal() override;
|
void CopyDisplayToOutput() override;
|
||||||
|
|
||||||
LPDIRECT3DDEVICE9 device_;
|
LPDIRECT3DDEVICE9 device_;
|
||||||
LPDIRECT3DDEVICE9EX deviceEx_;
|
LPDIRECT3DDEVICE9EX deviceEx_;
|
||||||
|
|
|
@ -401,13 +401,14 @@ void GPU_GLES::DeviceRestore() {
|
||||||
UpdateVsyncInterval(true);
|
UpdateVsyncInterval(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_GLES::ReinitializeInternal() {
|
void GPU_GLES::Reinitialize() {
|
||||||
|
GPUCommon::Reinitialize();
|
||||||
textureCacheGL_->Clear(true);
|
textureCacheGL_->Clear(true);
|
||||||
depalShaderCache_.Clear();
|
depalShaderCache_.Clear();
|
||||||
framebufferManagerGL_->DestroyAllFBOs();
|
framebufferManagerGL_->DestroyAllFBOs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_GLES::InitClearInternal() {
|
void GPU_GLES::InitClear() {
|
||||||
bool useNonBufferedRendering = g_Config.iRenderingMode == FB_NON_BUFFERED_MODE;
|
bool useNonBufferedRendering = g_Config.iRenderingMode == FB_NON_BUFFERED_MODE;
|
||||||
if (useNonBufferedRendering) {
|
if (useNonBufferedRendering) {
|
||||||
glstate.depthWrite.set(GL_TRUE);
|
glstate.depthWrite.set(GL_TRUE);
|
||||||
|
@ -467,13 +468,13 @@ void GPU_GLES::UpdateCmdInfo() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_GLES::ReapplyGfxStateInternal() {
|
void GPU_GLES::ReapplyGfxState() {
|
||||||
drawEngine_.RestoreVAO();
|
drawEngine_.RestoreVAO();
|
||||||
glstate.Restore();
|
glstate.Restore();
|
||||||
GPUCommon::ReapplyGfxStateInternal();
|
GPUCommon::ReapplyGfxState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_GLES::BeginFrameInternal() {
|
void GPU_GLES::BeginFrame() {
|
||||||
UpdateVsyncInterval(resized_);
|
UpdateVsyncInterval(resized_);
|
||||||
resized_ = false;
|
resized_ = false;
|
||||||
|
|
||||||
|
@ -483,7 +484,7 @@ void GPU_GLES::BeginFrameInternal() {
|
||||||
depalShaderCache_.Decimate();
|
depalShaderCache_.Decimate();
|
||||||
fragmentTestCache_.Decimate();
|
fragmentTestCache_.Decimate();
|
||||||
|
|
||||||
GPUCommon::BeginFrameInternal();
|
GPUCommon::BeginFrame();
|
||||||
|
|
||||||
// Save the cache from time to time. TODO: How often?
|
// Save the cache from time to time. TODO: How often?
|
||||||
if (!shaderCachePath_.empty() && (gpuStats.numFlips & 1023) == 0) {
|
if (!shaderCachePath_.empty() && (gpuStats.numFlips & 1023) == 0) {
|
||||||
|
@ -523,7 +524,7 @@ bool GPU_GLES::FramebufferReallyDirty() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_GLES::CopyDisplayToOutputInternal() {
|
void GPU_GLES::CopyDisplayToOutput() {
|
||||||
// Flush anything left over.
|
// Flush anything left over.
|
||||||
framebufferManagerGL_->RebindFramebuffer();
|
framebufferManagerGL_->RebindFramebuffer();
|
||||||
drawEngine_.Flush();
|
drawEngine_.Flush();
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
void PreExecuteOp(u32 op, u32 diff) override;
|
void PreExecuteOp(u32 op, u32 diff) override;
|
||||||
void ExecuteOp(u32 op, u32 diff) override;
|
void ExecuteOp(u32 op, u32 diff) override;
|
||||||
|
|
||||||
void ReapplyGfxStateInternal() override;
|
void ReapplyGfxState() override;
|
||||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||||
void GetStats(char *buffer, size_t bufsize) override;
|
void GetStats(char *buffer, size_t bufsize) override;
|
||||||
|
|
||||||
|
@ -95,10 +95,10 @@ private:
|
||||||
void CheckFlushOp(int cmd, u32 diff);
|
void CheckFlushOp(int cmd, u32 diff);
|
||||||
void BuildReportingInfo();
|
void BuildReportingInfo();
|
||||||
|
|
||||||
void InitClearInternal() override;
|
void InitClear() override;
|
||||||
void BeginFrameInternal() override;
|
void BeginFrame() override;
|
||||||
void CopyDisplayToOutputInternal() override;
|
void CopyDisplayToOutput() override;
|
||||||
void ReinitializeInternal() override;
|
void Reinitialize() override;
|
||||||
|
|
||||||
inline void UpdateVsyncInterval(bool force);
|
inline void UpdateVsyncInterval(bool force);
|
||||||
void UpdateCmdInfo();
|
void UpdateCmdInfo();
|
||||||
|
|
|
@ -381,14 +381,6 @@ void GPUCommon::EndHostFrame() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUCommon::InitClear() {
|
|
||||||
InitClearInternal();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GPUCommon::CopyDisplayToOutput() {
|
|
||||||
CopyDisplayToOutputInternal();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GPUCommon::Reinitialize() {
|
void GPUCommon::Reinitialize() {
|
||||||
memset(dls, 0, sizeof(dls));
|
memset(dls, 0, sizeof(dls));
|
||||||
for (int i = 0; i < DisplayListMaxCount; ++i) {
|
for (int i = 0; i < DisplayListMaxCount; ++i) {
|
||||||
|
@ -404,7 +396,6 @@ void GPUCommon::Reinitialize() {
|
||||||
timeSpentStepping_ = 0.0;
|
timeSpentStepping_ = 0.0;
|
||||||
interruptsEnabled_ = true;
|
interruptsEnabled_ = true;
|
||||||
curTickEst_ = 0;
|
curTickEst_ = 0;
|
||||||
ReinitializeInternal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int GPUCommon::EstimatePerVertexCost() {
|
int GPUCommon::EstimatePerVertexCost() {
|
||||||
|
@ -927,10 +918,6 @@ bool GPUCommon::InterpretList(DisplayList &list) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUCommon::BeginFrame() {
|
void GPUCommon::BeginFrame() {
|
||||||
BeginFrameInternal();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GPUCommon::BeginFrameInternal() {
|
|
||||||
if (dumpNextFrame_) {
|
if (dumpNextFrame_) {
|
||||||
NOTICE_LOG(G3D, "DUMPING THIS FRAME");
|
NOTICE_LOG(G3D, "DUMPING THIS FRAME");
|
||||||
dumpThisFrame_ = true;
|
dumpThisFrame_ = true;
|
||||||
|
@ -994,10 +981,6 @@ void GPUCommon::UpdatePC(u32 currentPC, u32 newPC) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUCommon::ReapplyGfxState() {
|
void GPUCommon::ReapplyGfxState() {
|
||||||
ReapplyGfxStateInternal();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GPUCommon::ReapplyGfxStateInternal() {
|
|
||||||
// The commands are embedded in the command memory so we can just reexecute the words. Convenient.
|
// The commands are embedded in the command memory so we can just reexecute the words. Convenient.
|
||||||
// To be safe we pass 0xFFFFFFFF as the diff.
|
// To be safe we pass 0xFFFFFFFF as the diff.
|
||||||
|
|
||||||
|
@ -1037,12 +1020,7 @@ int GPUCommon::GetNextListIndex() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GPUCommon::ProcessDLQueue() {
|
void GPUCommon::ProcessDLQueue() {
|
||||||
ProcessDLQueueInternal();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GPUCommon::ProcessDLQueueInternal() {
|
|
||||||
startingTicks = CoreTiming::GetTicks();
|
startingTicks = CoreTiming::GetTicks();
|
||||||
cyclesExecuted = 0;
|
cyclesExecuted = 0;
|
||||||
curTickEst_ = std::max(busyTicks, startingTicks + cyclesExecuted);
|
curTickEst_ = std::max(busyTicks, startingTicks + cyclesExecuted);
|
||||||
|
@ -1326,7 +1304,7 @@ void GPUCommon::Execute_End(u32 op, u32 diff) {
|
||||||
__GeTriggerSync(GPU_SYNC_LIST, currentList->id, currentList->waitTicks);
|
__GeTriggerSync(GPU_SYNC_LIST, currentList->id, currentList->waitTicks);
|
||||||
if (currentList->started && currentList->context.IsValid()) {
|
if (currentList->started && currentList->context.IsValid()) {
|
||||||
gstate.Restore(currentList->context);
|
gstate.Restore(currentList->context);
|
||||||
ReapplyGfxStateInternal();
|
ReapplyGfxState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2231,27 +2209,17 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {
|
||||||
cyclesExecuted += ((height * width * bpp) * 16) / 10;
|
cyclesExecuted += ((height * width * bpp) * 16) / 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUCommon::PerformMemoryCopyInternal(u32 dest, u32 src, int size) {
|
|
||||||
if (!framebufferManager_->NotifyFramebufferCopy(src, dest, size, false, gstate_c.skipDrawReason)) {
|
|
||||||
// We use a little hack for Download/Upload using a VRAM mirror.
|
|
||||||
// Since they're identical we don't need to copy.
|
|
||||||
if (!Memory::IsVRAMAddress(dest) || (dest ^ 0x00400000) != src) {
|
|
||||||
Memory::Memcpy(dest, src, size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
InvalidateCache(dest, size, GPU_INVALIDATE_HINT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GPUCommon::PerformMemorySetInternal(u32 dest, u8 v, int size) {
|
|
||||||
if (!framebufferManager_->NotifyFramebufferCopy(dest, dest, size, true, gstate_c.skipDrawReason)) {
|
|
||||||
InvalidateCache(dest, size, GPU_INVALIDATE_HINT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GPUCommon::PerformMemoryCopy(u32 dest, u32 src, int size) {
|
bool GPUCommon::PerformMemoryCopy(u32 dest, u32 src, int size) {
|
||||||
// Track stray copies of a framebuffer in RAM. MotoGP does this.
|
// Track stray copies of a framebuffer in RAM. MotoGP does this.
|
||||||
if (framebufferManager_->MayIntersectFramebuffer(src) || framebufferManager_->MayIntersectFramebuffer(dest)) {
|
if (framebufferManager_->MayIntersectFramebuffer(src) || framebufferManager_->MayIntersectFramebuffer(dest)) {
|
||||||
PerformMemoryCopyInternal(dest, src, size);
|
if (!framebufferManager_->NotifyFramebufferCopy(src, dest, size, false, gstate_c.skipDrawReason)) {
|
||||||
|
// We use a little hack for Download/Upload using a VRAM mirror.
|
||||||
|
// Since they're identical we don't need to copy.
|
||||||
|
if (!Memory::IsVRAMAddress(dest) || (dest ^ 0x00400000) != src) {
|
||||||
|
Memory::Memcpy(dest, src, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
InvalidateCache(dest, size, GPU_INVALIDATE_HINT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2264,7 +2232,9 @@ bool GPUCommon::PerformMemorySet(u32 dest, u8 v, int size) {
|
||||||
// This may indicate a memset, usually to 0, of a framebuffer.
|
// This may indicate a memset, usually to 0, of a framebuffer.
|
||||||
if (framebufferManager_->MayIntersectFramebuffer(dest)) {
|
if (framebufferManager_->MayIntersectFramebuffer(dest)) {
|
||||||
Memory::Memset(dest, v, size);
|
Memory::Memset(dest, v, size);
|
||||||
PerformMemorySetInternal(dest, v, size);
|
if (!framebufferManager_->NotifyFramebufferCopy(dest, dest, size, true, gstate_c.skipDrawReason)) {
|
||||||
|
InvalidateCache(dest, size, GPU_INVALIDATE_HINT);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2294,10 +2264,6 @@ bool GPUCommon::PerformMemoryUpload(u32 dest, int size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUCommon::InvalidateCache(u32 addr, int size, GPUInvalidationType type) {
|
void GPUCommon::InvalidateCache(u32 addr, int size, GPUInvalidationType type) {
|
||||||
InvalidateCacheInternal(addr, size, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GPUCommon::InvalidateCacheInternal(u32 addr, int size, GPUInvalidationType type) {
|
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
textureCache_->Invalidate(addr, size, type);
|
textureCache_->Invalidate(addr, size, type);
|
||||||
else
|
else
|
||||||
|
@ -2322,16 +2288,12 @@ void GPUCommon::NotifyVideoUpload(u32 addr, int size, int width, int format) {
|
||||||
|
|
||||||
bool GPUCommon::PerformStencilUpload(u32 dest, int size) {
|
bool GPUCommon::PerformStencilUpload(u32 dest, int size) {
|
||||||
if (framebufferManager_->MayIntersectFramebuffer(dest)) {
|
if (framebufferManager_->MayIntersectFramebuffer(dest)) {
|
||||||
PerformStencilUploadInternal(dest, size);
|
framebufferManager_->NotifyStencilUpload(dest, size);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUCommon::PerformStencilUploadInternal(u32 dest, int size) {
|
|
||||||
framebufferManager_->NotifyStencilUpload(dest, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GPUCommon::GetCurrentFramebuffer(GPUDebugBuffer &buffer, GPUDebugFramebufferType type, int maxRes) {
|
bool GPUCommon::GetCurrentFramebuffer(GPUDebugBuffer &buffer, GPUDebugFramebufferType type, int maxRes) {
|
||||||
u32 fb_address = type == GPU_DBG_FRAMEBUF_RENDER ? gstate.getFrameBufRawAddress() : framebufferManager_->DisplayFramebufAddr();
|
u32 fb_address = type == GPU_DBG_FRAMEBUF_RENDER ? gstate.getFrameBufRawAddress() : framebufferManager_->DisplayFramebufAddr();
|
||||||
int fb_stride = type == GPU_DBG_FRAMEBUF_RENDER ? gstate.FrameBufStride() : framebufferManager_->DisplayFramebufStride();
|
int fb_stride = type == GPU_DBG_FRAMEBUF_RENDER ? gstate.FrameBufStride() : framebufferManager_->DisplayFramebufStride();
|
||||||
|
|
|
@ -66,7 +66,7 @@ public:
|
||||||
void PreExecuteOp(u32 op, u32 diff) override;
|
void PreExecuteOp(u32 op, u32 diff) override;
|
||||||
|
|
||||||
bool InterpretList(DisplayList &list) override;
|
bool InterpretList(DisplayList &list) override;
|
||||||
virtual bool ProcessDLQueue();
|
void ProcessDLQueue();
|
||||||
u32 UpdateStall(int listid, u32 newstall) override;
|
u32 UpdateStall(int listid, u32 newstall) override;
|
||||||
u32 EnqueueList(u32 listpc, u32 stall, int subIntrBase, PSPPointer<PspGeListArgs> args, bool head) override;
|
u32 EnqueueList(u32 listpc, u32 stall, int subIntrBase, PSPPointer<PspGeListArgs> args, bool head) override;
|
||||||
u32 DequeueList(int listid) override;
|
u32 DequeueList(int listid) override;
|
||||||
|
@ -79,8 +79,8 @@ public:
|
||||||
u32 Break(int mode) override;
|
u32 Break(int mode) override;
|
||||||
void ReapplyGfxState() override;
|
void ReapplyGfxState() override;
|
||||||
|
|
||||||
void CopyDisplayToOutput() override;
|
void CopyDisplayToOutput() override = 0;
|
||||||
void InitClear() override;
|
void InitClear() override = 0;
|
||||||
bool PerformMemoryCopy(u32 dest, u32 src, int size) override;
|
bool PerformMemoryCopy(u32 dest, u32 src, int size) override;
|
||||||
bool PerformMemorySet(u32 dest, u8 v, int size) override;
|
bool PerformMemorySet(u32 dest, u8 v, int size) override;
|
||||||
bool PerformMemoryDownload(u32 dest, int size) override;
|
bool PerformMemoryDownload(u32 dest, int size) override;
|
||||||
|
@ -105,10 +105,6 @@ public:
|
||||||
void Execute_BoundingBox(u32 op, u32 diff);
|
void Execute_BoundingBox(u32 op, u32 diff);
|
||||||
void Execute_BlockTransferStart(u32 op, u32 diff);
|
void Execute_BlockTransferStart(u32 op, u32 diff);
|
||||||
|
|
||||||
void Execute_TexScaleU(u32 op, u32 diff);
|
|
||||||
void Execute_TexScaleV(u32 op, u32 diff);
|
|
||||||
void Execute_TexOffsetU(u32 op, u32 diff);
|
|
||||||
void Execute_TexOffsetV(u32 op, u32 diff);
|
|
||||||
void Execute_TexLevel(u32 op, u32 diff);
|
void Execute_TexLevel(u32 op, u32 diff);
|
||||||
|
|
||||||
void Execute_WorldMtxNum(u32 op, u32 diff);
|
void Execute_WorldMtxNum(u32 op, u32 diff);
|
||||||
|
@ -233,11 +229,7 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void InitClearInternal() {}
|
|
||||||
void BeginFrame() override;
|
void BeginFrame() override;
|
||||||
virtual void BeginFrameInternal();
|
|
||||||
virtual void CopyDisplayToOutputInternal() {}
|
|
||||||
virtual void ReinitializeInternal() {}
|
|
||||||
|
|
||||||
// To avoid virtual calls to PreExecuteOp().
|
// To avoid virtual calls to PreExecuteOp().
|
||||||
virtual void FastRunLoop(DisplayList &list) = 0;
|
virtual void FastRunLoop(DisplayList &list) = 0;
|
||||||
|
@ -247,8 +239,6 @@ protected:
|
||||||
void PopDLQueue();
|
void PopDLQueue();
|
||||||
void CheckDrawSync();
|
void CheckDrawSync();
|
||||||
int GetNextListIndex();
|
int GetNextListIndex();
|
||||||
void ProcessDLQueueInternal();
|
|
||||||
virtual void ReapplyGfxStateInternal();
|
|
||||||
virtual void FastLoadBoneMatrix(u32 target);
|
virtual void FastLoadBoneMatrix(u32 target);
|
||||||
|
|
||||||
// TODO: Unify this.
|
// TODO: Unify this.
|
||||||
|
@ -265,11 +255,6 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerformMemoryCopyInternal(u32 dest, u32 src, int size);
|
|
||||||
void PerformMemorySetInternal(u32 dest, u8 v, int size);
|
|
||||||
void PerformStencilUploadInternal(u32 dest, int size);
|
|
||||||
void InvalidateCacheInternal(u32 addr, int size, GPUInvalidationType type);
|
|
||||||
|
|
||||||
FramebufferManagerCommon *framebufferManager_;
|
FramebufferManagerCommon *framebufferManager_;
|
||||||
TextureCacheCommon *textureCache_;
|
TextureCacheCommon *textureCache_;
|
||||||
DrawEngineCommon *drawEngineCommon_;
|
DrawEngineCommon *drawEngineCommon_;
|
||||||
|
|
|
@ -281,13 +281,7 @@ void SoftGPU::CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight) {
|
||||||
draw_->BindIndexBuffer(nullptr, 0);
|
draw_->BindIndexBuffer(nullptr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoftGPU::CopyDisplayToOutput()
|
void SoftGPU::CopyDisplayToOutput() {
|
||||||
{
|
|
||||||
CopyDisplayToOutputInternal();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SoftGPU::CopyDisplayToOutputInternal()
|
|
||||||
{
|
|
||||||
// The display always shows 480x272.
|
// The display always shows 480x272.
|
||||||
CopyToCurrentFboFromDisplayRam(FB_WIDTH, FB_HEIGHT);
|
CopyToCurrentFboFromDisplayRam(FB_WIDTH, FB_HEIGHT);
|
||||||
framebufferDirty_ = false;
|
framebufferDirty_ = false;
|
||||||
|
|
|
@ -97,8 +97,6 @@ protected:
|
||||||
void CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight);
|
void CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CopyDisplayToOutputInternal() override;
|
|
||||||
|
|
||||||
bool framebufferDirty_;
|
bool framebufferDirty_;
|
||||||
u32 displayFramebuf_;
|
u32 displayFramebuf_;
|
||||||
u32 displayStride_;
|
u32 displayStride_;
|
||||||
|
|
|
@ -332,21 +332,17 @@ void GPU_Vulkan::BuildReportingInfo() {
|
||||||
Reporting::UpdateConfig();
|
Reporting::UpdateConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_Vulkan::ReinitializeInternal() {
|
void GPU_Vulkan::Reinitialize() {
|
||||||
|
GPUCommon::Reinitialize();
|
||||||
textureCacheVulkan_->Clear(true);
|
textureCacheVulkan_->Clear(true);
|
||||||
depalShaderCache_.Clear();
|
depalShaderCache_.Clear();
|
||||||
framebufferManagerVulkan_->DestroyAllFBOs();
|
framebufferManagerVulkan_->DestroyAllFBOs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_Vulkan::InitClearInternal() {
|
void GPU_Vulkan::InitClear() {
|
||||||
bool useNonBufferedRendering = g_Config.iRenderingMode == FB_NON_BUFFERED_MODE;
|
bool useNonBufferedRendering = g_Config.iRenderingMode == FB_NON_BUFFERED_MODE;
|
||||||
if (useNonBufferedRendering) {
|
if (useNonBufferedRendering) {
|
||||||
/*
|
// TODO?
|
||||||
glstate.depthWrite.set(GL_TRUE);
|
|
||||||
glstate.colorMask.set(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
|
||||||
glClearColor(0, 0, 0, 1);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +385,7 @@ bool GPU_Vulkan::FramebufferReallyDirty() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_Vulkan::CopyDisplayToOutputInternal() {
|
void GPU_Vulkan::CopyDisplayToOutput() {
|
||||||
// Flush anything left over.
|
// Flush anything left over.
|
||||||
drawEngine_.Flush();
|
drawEngine_.Flush();
|
||||||
|
|
||||||
|
|
|
@ -96,9 +96,9 @@ private:
|
||||||
}
|
}
|
||||||
void CheckFlushOp(int cmd, u32 diff);
|
void CheckFlushOp(int cmd, u32 diff);
|
||||||
void BuildReportingInfo();
|
void BuildReportingInfo();
|
||||||
void InitClearInternal() override;
|
void InitClear() override;
|
||||||
void CopyDisplayToOutputInternal() override;
|
void CopyDisplayToOutput() override;
|
||||||
void ReinitializeInternal() override;
|
void Reinitialize() override;
|
||||||
inline void UpdateVsyncInterval(bool force);
|
inline void UpdateVsyncInterval(bool force);
|
||||||
void UpdateCmdInfo();
|
void UpdateCmdInfo();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue