Revert r7421 and r7422.

Should fix issue 4413.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7592 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2011-06-11 19:37:21 +00:00
parent e5210de9d5
commit 8244efcc02
42 changed files with 1647 additions and 1420 deletions

View File

@ -23,7 +23,6 @@
#include "FramebufferManagerBase.h"
#include "D3DTexture.h"
#include "XFBEncoder.h"
namespace DX11 {
@ -61,16 +60,15 @@ namespace DX11 {
struct XFBSource : public XFBSourceBase
{
XFBSource(std::unique_ptr<D3DTexture2D>&& _tex)
: tex(std::move(_tex))
{}
XFBSource(D3DTexture2D *_tex) : tex(_tex) {}
~XFBSource() { tex->Release(); }
void Draw(const MathUtil::Rectangle<float> &sourcerc,
const MathUtil::Rectangle<float> &drawrc, int width, int height) const;
void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight);
void CopyEFB(float Gamma);
std::unique_ptr<D3DTexture2D> const tex;
D3DTexture2D* const tex;
};
class FramebufferManager : public FramebufferManagerBase
@ -79,21 +77,22 @@ public:
FramebufferManager();
~FramebufferManager();
static D3DTexture2D* GetEFBColorTexture() { return m_efb.color_tex.get(); }
static ID3D11Texture2D* GetEFBColorStagingBuffer() { return m_efb.color_staging_buf; }
static D3DTexture2D* &GetEFBColorTexture();
static ID3D11Texture2D* &GetEFBColorStagingBuffer();
static D3DTexture2D* GetEFBDepthTexture() { return m_efb.depth_tex.get(); }
static D3DTexture2D* GetEFBDepthReadTexture() { return m_efb.depth_read_texture.get(); }
static ID3D11Texture2D* GetEFBDepthStagingBuffer() { return m_efb.depth_staging_buf; }
static D3DTexture2D* &GetEFBDepthTexture();
static D3DTexture2D* &GetEFBDepthReadTexture();
static ID3D11Texture2D* &GetEFBDepthStagingBuffer();
static D3DTexture2D* GetResolvedEFBColorTexture();
static D3DTexture2D* GetResolvedEFBDepthTexture();
static D3DTexture2D* &GetResolvedEFBColorTexture();
static D3DTexture2D* &GetResolvedEFBDepthTexture();
static D3DTexture2D* GetEFBColorTempTexture() { return m_efb.color_temp_tex.get(); }
static D3DTexture2D* &GetEFBColorTempTexture() { return m_efb.color_temp_tex; }
static void SwapReinterpretTexture()
{
std::swap(m_efb.color_temp_tex, m_efb.color_tex);
D3DTexture2D* swaptex = GetEFBColorTempTexture();
m_efb.color_temp_tex = GetEFBColorTexture();
m_efb.color_tex = swaptex;
}
private:
@ -104,20 +103,18 @@ private:
static struct Efb
{
std::unique_ptr<D3DTexture2D> color_tex;
SharedPtr<ID3D11Texture2D> color_staging_buf;
D3DTexture2D* color_tex;
ID3D11Texture2D* color_staging_buf;
std::unique_ptr<D3DTexture2D> depth_tex;
SharedPtr<ID3D11Texture2D> depth_staging_buf;
std::unique_ptr<D3DTexture2D> depth_read_texture;
D3DTexture2D* depth_tex;
ID3D11Texture2D* depth_staging_buf;
D3DTexture2D* depth_read_texture;
std::unique_ptr<D3DTexture2D> color_temp_tex;
D3DTexture2D* color_temp_tex;
std::unique_ptr<D3DTexture2D> resolved_color_tex;
std::unique_ptr<D3DTexture2D> resolved_depth_tex;
D3DTexture2D* resolved_color_tex;
D3DTexture2D* resolved_depth_tex;
} m_efb;
XFBEncoder m_xfbEncoder;
};
} // namespace DX11