Use EXT_framebuffer_blit whenever possible. Some video cards may not handle glCopyTexImage2D correctly.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3607 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Nolan Check 2009-06-29 21:54:42 +00:00
parent 9ccf992aaa
commit 5064c0decc
2 changed files with 15 additions and 5 deletions

View File

@ -21,6 +21,8 @@
#include "TextureConverter.h"
#include "XFB.h"
extern bool s_bHaveFramebufferBlit; // comes from Render.cpp
void FramebufferManager::Init(int targetWidth, int targetHeight, int msaaSamples, int msaaCoverageSamples)
{
m_targetWidth = targetWidth;
@ -105,10 +107,6 @@ void FramebufferManager::Init(int targetWidth, int targetHeight, int msaaSamples
GL_REPORT_FBO_ERROR();
// Create XFB framebuffer; targets will be created elsewhere.
glGenFramebuffersEXT(1, &m_xfbFramebuffer);
// Create resolved targets for transferring multisampled EFB to texture.
glGenFramebuffersEXT(1, &m_resolvedFramebuffer);
@ -139,6 +137,10 @@ void FramebufferManager::Init(int targetWidth, int targetHeight, int msaaSamples
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_efbFramebuffer);
}
// Create XFB framebuffer; targets will be created elsewhere.
glGenFramebuffersEXT(1, &m_xfbFramebuffer);
// EFB framebuffer is currently bound.
}
@ -322,7 +324,11 @@ void FramebufferManager::copyToVirtualXFB(u32 xfbAddr, u32 dstWidth, u32 dstHeig
glGenTextures(1, &xfbTexture);
#if 0 // XXX: Some video drivers don't handle glCopyTexImage2D correctly, so use EXT_framebuffer_blit whenever possible.
if (m_msaaSamples > 1)
#else
if (s_bHaveFramebufferBlit)
#endif
{
// In MSAA mode, allocate the texture image here. In non-MSAA mode,
// the image will be allocated by glCopyTexImage2D (later).
@ -358,7 +364,11 @@ void FramebufferManager::copyToVirtualXFB(u32 xfbAddr, u32 dstWidth, u32 dstHeig
// Copy EFB to XFB texture
#if 0
if (m_msaaSamples <= 1)
#else
if (!s_bHaveFramebufferBlit)
#endif
{
// Just copy the EFB directly.

View File

@ -94,7 +94,7 @@ static int s_MSAASamples = 1;
static int s_MSAACoverageSamples = 0;
static bool s_bHaveStencilBuffer = false;
static bool s_bHaveFramebufferBlit = false;
bool s_bHaveFramebufferBlit = false; // export to FramebufferManager.cpp
static bool s_bHaveCoverageMSAA = false;
static u32 s_blendMode;
static bool s_bNativeResolution = false;