mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-30 17:02:19 +00:00
d3d: Add FlushBeforeCopy().
This commit is contained in:
parent
bdaabfe2f7
commit
6f991a1042
@ -159,11 +159,16 @@ public:
|
||||
GEBufferFormat GetTargetFormat() const { return currentRenderVfb_ ? currentRenderVfb_->format : displayFormat_; }
|
||||
|
||||
protected:
|
||||
virtual void DisableState() = 0;
|
||||
virtual void ClearBuffer() = 0;
|
||||
virtual void ClearDepthBuffer() = 0;
|
||||
virtual void FlushBeforeCopy() = 0;
|
||||
virtual void DecimateFBOs() = 0;
|
||||
|
||||
void EstimateDrawingSize(int &drawing_width, int &drawing_height);
|
||||
u32 FramebufferByteSize(const VirtualFramebuffer *vfb) const;
|
||||
static bool MaskedEqual(u32 addr1, u32 addr2);
|
||||
|
||||
virtual void DecimateFBOs() = 0;
|
||||
virtual void DestroyFramebuf(VirtualFramebuffer *vfb) = 0;
|
||||
virtual void ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h, bool force = false) = 0;
|
||||
virtual void NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) = 0;
|
||||
@ -182,10 +187,6 @@ protected:
|
||||
dstBuffer->reallyDirtyAfterDisplay = true;
|
||||
}
|
||||
|
||||
virtual void DisableState() = 0;
|
||||
virtual void ClearBuffer() = 0;
|
||||
virtual void ClearDepthBuffer() = 0;
|
||||
|
||||
u32 displayFramebufPtr_;
|
||||
u32 displayStride_;
|
||||
GEBufferFormat displayFormat_;
|
||||
|
@ -29,8 +29,9 @@
|
||||
|
||||
#include "GPU/Common/FramebufferCommon.h"
|
||||
#include "GPU/Directx9/FramebufferDX9.h"
|
||||
#include "GPU/Directx9/TextureCacheDX9.h"
|
||||
#include "GPU/Directx9/ShaderManagerDX9.h"
|
||||
#include "GPU/Directx9/TextureCacheDX9.h"
|
||||
#include "GPU/Directx9/TransformPipelineDX9.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@ -986,8 +987,7 @@ namespace DX9 {
|
||||
for (size_t i = 0; i < vfbs_.size(); ++i) {
|
||||
VirtualFramebuffer *vfb = vfbs_[i];
|
||||
if (MaskedEqual(vfb->fb_address, addr)) {
|
||||
// TODO
|
||||
//FlushBeforeCopy();
|
||||
FlushBeforeCopy();
|
||||
|
||||
if (useBufferedRendering_ && vfb->fbo) {
|
||||
DisableState();
|
||||
@ -1012,6 +1012,13 @@ namespace DX9 {
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::FlushBeforeCopy() {
|
||||
// Flush anything not yet drawn before blitting, downloading, or uploading.
|
||||
// This might be a stalled list, or unflushed before a block transfer, etc.
|
||||
SetRenderFrameBuffer();
|
||||
transformDraw_->Flush();
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::Resized() {
|
||||
resized_ = true;
|
||||
}
|
||||
|
@ -34,15 +34,14 @@
|
||||
|
||||
namespace DX9 {
|
||||
|
||||
struct GLSLProgram;
|
||||
class TextureCacheDX9;
|
||||
class TransformDrawEngineDX9;
|
||||
class ShaderManagerDX9;
|
||||
|
||||
void CenterRect(float *x, float *y, float *w, float *h,
|
||||
float origW, float origH, float frameW, float frameH);
|
||||
|
||||
|
||||
class ShaderManagerDX9;
|
||||
|
||||
class FramebufferManagerDX9 : public FramebufferManagerCommon {
|
||||
public:
|
||||
FramebufferManagerDX9();
|
||||
@ -54,6 +53,9 @@ public:
|
||||
void SetShaderManager(ShaderManagerDX9 *sm) {
|
||||
shaderManager_ = sm;
|
||||
}
|
||||
void SetTransformDrawEngine(TransformDrawEngineDX9 *td) {
|
||||
transformDraw_ = td;
|
||||
}
|
||||
|
||||
void MakePixelTexture(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height);
|
||||
|
||||
@ -88,13 +90,13 @@ protected:
|
||||
virtual void DisableState() override;
|
||||
virtual void ClearBuffer() override;
|
||||
virtual void ClearDepthBuffer() override;
|
||||
virtual void FlushBeforeCopy() override;
|
||||
virtual void DecimateFBOs() override;
|
||||
|
||||
virtual void NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) override;
|
||||
virtual void NotifyRenderFramebufferSwitched(VirtualFramebuffer *prevVfb, VirtualFramebuffer *vfb) override;
|
||||
virtual void NotifyRenderFramebufferUpdated(VirtualFramebuffer *vfb, bool vfbFormatChanged) override;
|
||||
|
||||
virtual void DecimateFBOs() override;
|
||||
|
||||
private:
|
||||
void CompileDraw2DProgram();
|
||||
void DestroyDraw2DProgram();
|
||||
@ -115,6 +117,7 @@ private:
|
||||
|
||||
TextureCacheDX9 *textureCache_;
|
||||
ShaderManagerDX9 *shaderManager_;
|
||||
TransformDrawEngineDX9 *transformDraw_;
|
||||
bool usePostShader_;
|
||||
bool postShaderAtOutputResolution_;
|
||||
|
||||
|
@ -398,6 +398,7 @@ DIRECTX9_GPU::DIRECTX9_GPU()
|
||||
transformDraw_.SetFramebufferManager(&framebufferManager_);
|
||||
framebufferManager_.SetTextureCache(&textureCache_);
|
||||
framebufferManager_.SetShaderManager(shaderManager_);
|
||||
framebufferManager_.SetTransformDrawEngine(&transformDraw_);
|
||||
textureCache_.SetFramebufferManager(&framebufferManager_);
|
||||
textureCache_.SetShaderManager(shaderManager_);
|
||||
|
||||
|
@ -127,17 +127,16 @@ protected:
|
||||
virtual void DisableState() override;
|
||||
virtual void ClearBuffer() override;
|
||||
virtual void ClearDepthBuffer() override;
|
||||
virtual void FlushBeforeCopy() override;
|
||||
virtual void DecimateFBOs() override;
|
||||
|
||||
virtual void NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) override;
|
||||
virtual void NotifyRenderFramebufferSwitched(VirtualFramebuffer *prevVfb, VirtualFramebuffer *vfb) override;
|
||||
virtual void NotifyRenderFramebufferUpdated(VirtualFramebuffer *vfb, bool vfbFormatChanged) override;
|
||||
|
||||
virtual void DecimateFBOs() override;
|
||||
|
||||
private:
|
||||
void CompileDraw2DProgram();
|
||||
void DestroyDraw2DProgram();
|
||||
void FlushBeforeCopy();
|
||||
|
||||
void FindTransferFramebuffers(VirtualFramebuffer *&dstBuffer, VirtualFramebuffer *&srcBuffer, u32 dstBasePtr, int dstStride, int &dstX, int &dstY, u32 srcBasePtr, int srcStride, int &srcX, int &srcY, int &srcWidth, int &srcHeight, int &dstWidth, int &dstHeight, int bpp) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user