mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
added option to use XFB in GL, but XFB support still needs work. modified viewport to include scissor offset.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@879 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -30,6 +30,7 @@
|
||||
#include "TextureDecoder.h"
|
||||
#include "VertexShaderManager.h"
|
||||
#include "PixelShaderManager.h"
|
||||
#include "XFB.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
@ -592,19 +593,19 @@ bool SetScissorRect()
|
||||
|
||||
RECT rc;
|
||||
|
||||
rc.left = bpmem.scissorTL.x + xoff - 342; // left = 0
|
||||
rc.left = bpmem.scissorTL.x - xoff - 342; // left = 0
|
||||
rc.left *= MValueX;
|
||||
if (rc.left < 0) rc.left = 0;
|
||||
|
||||
rc.top = bpmem.scissorTL.y + yoff - 342; // right = 0
|
||||
rc.top = bpmem.scissorTL.y - yoff - 342; // right = 0
|
||||
rc.top *= MValueY;
|
||||
if (rc.top < 0) rc.top = 0;
|
||||
|
||||
rc.right = bpmem.scissorBR.x + xoff - 342; // right = 640
|
||||
rc.right = bpmem.scissorBR.x - xoff - 342; // right = 640
|
||||
rc.right *= MValueX;
|
||||
if (rc.right > 640 * MValueX) rc.right = 640 * MValueX;
|
||||
|
||||
rc.bottom = bpmem.scissorBR.y + yoff - 342; // bottom = 480
|
||||
rc.bottom = bpmem.scissorBR.y - yoff - 342; // bottom = 480
|
||||
rc.bottom *= MValueY;
|
||||
if (rc.bottom > 480 * MValueY) rc.bottom = 480 * MValueY;
|
||||
|
||||
@ -684,15 +685,15 @@ void LoadBPReg(u32 value0)
|
||||
TRectangle rc = {
|
||||
(int)(bpmem.copyTexSrcXY.x),
|
||||
(int)(bpmem.copyTexSrcXY.y),
|
||||
(int)((bpmem.copyTexSrcXY.x + bpmem.copyTexSrcWH.x)),
|
||||
(int)((bpmem.copyTexSrcXY.y + bpmem.copyTexSrcWH.y))
|
||||
(int)((bpmem.copyTexSrcXY.x + bpmem.copyTexSrcWH.x + 1)),
|
||||
(int)((bpmem.copyTexSrcXY.y + bpmem.copyTexSrcWH.y + 1))
|
||||
};
|
||||
//Need another rc here to get it to scale.
|
||||
TRectangle multirc = {
|
||||
(int)(bpmem.copyTexSrcXY.x * MValueX),
|
||||
(int)(bpmem.copyTexSrcXY.y * MValueY),
|
||||
(int)((bpmem.copyTexSrcXY.x * MValueX + bpmem.copyTexSrcWH.x * MValueX)),
|
||||
(int)((bpmem.copyTexSrcXY.y * MValueY + bpmem.copyTexSrcWH.y * MValueY))
|
||||
(int)((bpmem.copyTexSrcXY.x * MValueX + (bpmem.copyTexSrcWH.x + 1) * MValueX)),
|
||||
(int)((bpmem.copyTexSrcXY.y * MValueY + (bpmem.copyTexSrcWH.y + 1) * MValueY))
|
||||
};
|
||||
|
||||
UPE_Copy PE_copy;
|
||||
@ -706,8 +707,15 @@ void LoadBPReg(u32 value0)
|
||||
}
|
||||
else {
|
||||
// EFB to XFB
|
||||
Renderer::Swap(multirc);
|
||||
g_VideoInitialize.pCopiedToXFB();
|
||||
if(g_Config.bUseXFB)
|
||||
{
|
||||
XFB_Write(Memory_GetPtr(bpmem.copyTexDest<<5), multirc, (bpmem.copyMipMapStrideChannels << 4), bpmem.copyTexSrcWH.y + 1, bpmem.dispcopyyscale/256.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Renderer::Swap(multirc);
|
||||
}
|
||||
g_VideoInitialize.pCopiedToXFB();
|
||||
}
|
||||
|
||||
// clearing
|
||||
|
@ -41,6 +41,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
||||
EVT_CHECKBOX(ID_SHADERERRORS,ConfigDialog::ShowShaderErrorsCheck)
|
||||
EVT_CHECKBOX(ID_TEXFMTOVERLAY,ConfigDialog::TexFmtOverlayChange)
|
||||
EVT_CHECKBOX(ID_TEXFMTCENTER,ConfigDialog::TexFmtOverlayChange)
|
||||
EVT_CHECKBOX(ID_USEXFB,ConfigDialog::UseXFBChange)
|
||||
EVT_CHECKBOX(ID_DUMPTEXTURES,ConfigDialog::DumpTexturesChange)
|
||||
EVT_DIRPICKER_CHANGED(ID_TEXTUREPATH,ConfigDialog::TexturePathChange)
|
||||
END_EVENT_TABLE()
|
||||
@ -145,6 +146,9 @@ void ConfigDialog::CreateGUIControls()
|
||||
m_TexFmtCenter->SetValue(g_Config.bTexFmtOverlayCenter);
|
||||
m_TexFmtCenter->Enable(m_TexFmtOverlay->IsChecked());
|
||||
|
||||
m_UseXFB = new wxCheckBox(m_PageAdvanced, ID_USEXFB, wxT("Use XFB"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_UseXFB->SetValue(g_Config.bUseXFB);
|
||||
|
||||
m_DumpTextures = new wxCheckBox(m_PageAdvanced, ID_DUMPTEXTURES, wxT("Dump textures to:"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_DumpTextures->SetValue(g_Config.bDumpTextures);
|
||||
m_TexturePath = new wxDirPickerCtrl(m_PageAdvanced, ID_TEXTUREPATH, wxEmptyString, wxT("Choose a directory to store texture dumps:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
|
||||
@ -195,8 +199,9 @@ void ConfigDialog::CreateGUIControls()
|
||||
sPage3->Add(m_Statistics, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||
sPage3->Add(m_TexFmtOverlay, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||
sPage3->Add(m_TexFmtCenter, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sPage3->Add(m_DumpTextures, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||
sPage3->Add(m_TexturePath, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sPage3->Add(m_UseXFB, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||
sPage3->Add(m_DumpTextures, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||
sPage3->Add(m_TexturePath, wxGBPosition(6, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
m_PageAdvanced->SetSizer(sPage3);
|
||||
sPage3->Layout();
|
||||
|
||||
@ -318,6 +323,11 @@ void ConfigDialog::TexFmtOverlayChange(wxCommandEvent& event)
|
||||
TextureMngr::Invalidate();
|
||||
}
|
||||
|
||||
void ConfigDialog::UseXFBChange(wxCommandEvent& event)
|
||||
{
|
||||
g_Config.bUseXFB = m_UseXFB->IsChecked();
|
||||
}
|
||||
|
||||
void ConfigDialog::DumpTexturesChange(wxCommandEvent& event)
|
||||
{
|
||||
m_TexturePath->Enable(m_DumpTextures->IsChecked());
|
||||
@ -336,4 +346,4 @@ void ConfigDialog::DllAbout(wxCommandEvent& event)
|
||||
info.AddDeveloper(_T("zerofrog(@gmail.com)"));
|
||||
info.SetDescription(_T("Vertex/Pixel Shader 2.0 or higher, framebuffer objects, multiple render targets"));
|
||||
wxAboutBox(info);
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ class ConfigDialog : public wxDialog
|
||||
void OverlayCheck(wxCommandEvent& event);
|
||||
void ShowShaderErrorsCheck(wxCommandEvent& event);
|
||||
void TexFmtOverlayChange(wxCommandEvent& event);
|
||||
void UseXFBChange(wxCommandEvent& event);
|
||||
void DumpTexturesChange(wxCommandEvent& event);
|
||||
void TexturePathChange(wxFileDirPickerEvent& event);
|
||||
void DllAbout(wxCommandEvent& event);
|
||||
@ -76,6 +77,7 @@ class ConfigDialog : public wxDialog
|
||||
wxButton *m_OK;
|
||||
wxDirPickerCtrl *m_TexturePath;
|
||||
wxCheckBox *m_DumpTextures;
|
||||
wxCheckBox *m_UseXFB;
|
||||
wxCheckBox *m_TexFmtCenter;
|
||||
wxCheckBox *m_TexFmtOverlay;
|
||||
wxCheckBox *m_Statistics;
|
||||
@ -105,6 +107,7 @@ class ConfigDialog : public wxDialog
|
||||
ID_OK,
|
||||
ID_TEXTUREPATH,
|
||||
ID_SHADERERRORS,
|
||||
ID_USEXFB,
|
||||
ID_TEXFMTCENTER,
|
||||
ID_TEXFMTOVERLAY,
|
||||
ID_SHOWFPS,
|
||||
|
@ -90,6 +90,7 @@ void Config::Load()
|
||||
|
||||
iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
|
||||
iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
|
||||
iniFile.Get("Settings", "UseXFB", &bUseXFB, 0);
|
||||
|
||||
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
|
||||
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
|
||||
@ -118,6 +119,7 @@ void Config::Save()
|
||||
iniFile.Set("Settings", "TexDumpPath", texDumpPath);
|
||||
iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
|
||||
iniFile.Set("Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
|
||||
iniFile.Set("Settings", "UseXFB", bUseXFB);
|
||||
|
||||
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
|
||||
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
|
||||
|
@ -141,6 +141,7 @@ struct Config
|
||||
bool bTexFmtOverlayEnable;
|
||||
bool bTexFmtOverlayCenter;
|
||||
bool bOverlayStats;
|
||||
bool bUseXFB;
|
||||
bool bDumpTextures;
|
||||
char texDumpPath[280];
|
||||
|
||||
|
@ -707,7 +707,21 @@ void Renderer::Swap(const TRectangle& rc)
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);
|
||||
TextureMngr::DisableStage(0);
|
||||
|
||||
static int fpscount;
|
||||
SwapBuffers();
|
||||
|
||||
RestoreGLState();
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
g_Config.iSaveTargetId = 0;
|
||||
|
||||
// for testing zbuffer targets
|
||||
//Renderer::SetZBufferRender();
|
||||
//SaveTexture("tex.tga", GL_TEXTURE_RECTANGLE_ARB, s_ZBufferTarget, GetTargetWidth(), GetTargetHeight());
|
||||
}
|
||||
|
||||
void Renderer::SwapBuffers()
|
||||
{
|
||||
static int fpscount;
|
||||
static int s_fps;
|
||||
static unsigned long lasttime;
|
||||
++fpscount;
|
||||
@ -812,15 +826,6 @@ void Renderer::Swap(const TRectangle& rc)
|
||||
Renderer::SetRenderMode(RM_Normal); // turn off any zwrites
|
||||
}
|
||||
}
|
||||
|
||||
RestoreGLState();
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
g_Config.iSaveTargetId = 0;
|
||||
|
||||
// for testing zbuffer targets
|
||||
//Renderer::SetZBufferRender();
|
||||
//SaveTexture("tex.tga", GL_TEXTURE_RECTANGLE_ARB, s_ZBufferTarget, GetTargetWidth(), GetTargetHeight());
|
||||
}
|
||||
|
||||
bool Renderer::SaveRenderTarget(const char* filename, int jpeg)
|
||||
|
@ -73,6 +73,8 @@ public:
|
||||
// Finish up the current frame, print some stats
|
||||
static void Swap(const TRectangle& rc);
|
||||
|
||||
static void SwapBuffers();
|
||||
|
||||
static bool SaveRenderTarget(const char* filename, int jpeg);
|
||||
};
|
||||
|
||||
|
@ -344,6 +344,8 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs)
|
||||
// -------------
|
||||
// rawViewport[0] = 320, rawViewport[1] = -240
|
||||
// -------------
|
||||
int scissorXOff = bpmem.scissorOffset.x * 2 - 342;
|
||||
int scissorYOff = bpmem.scissorOffset.y * 2 - 342;
|
||||
float fourThree = 4.0f/3.0f;
|
||||
float ratio = AR / fourThree;
|
||||
float hAdj; float wAdj; float actualRatiow; float actualRatioh;
|
||||
@ -391,16 +393,16 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs)
|
||||
if(g_Config.bStretchToFit && g_Config.renderToMainframe)
|
||||
{
|
||||
glViewport(
|
||||
(int)(rawViewport[3]-rawViewport[0]-342) + xoffs,
|
||||
Renderer::GetTargetHeight() - ((int)(rawViewport[4]-rawViewport[1]-342)) + yoffs,
|
||||
(int)(rawViewport[3]-rawViewport[0]-342-scissorXOff) + xoffs,
|
||||
Renderer::GetTargetHeight() - ((int)(rawViewport[4]-rawViewport[1]-342-scissorYOff)) + yoffs,
|
||||
wid, // width
|
||||
hei // height
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
glViewport((int)(rawViewport[3]-rawViewport[0]-342) * MValueX,
|
||||
Renderer::GetTargetHeight()-((int)(rawViewport[4]-rawViewport[1]-342)) * MValueY,
|
||||
glViewport((int)(rawViewport[3]-rawViewport[0]-342-scissorXOff) * MValueX,
|
||||
Renderer::GetTargetHeight()-((int)(rawViewport[4]-rawViewport[1]-342-scissorYOff)) * MValueY,
|
||||
abs((int)(2 * rawViewport[0])) * MValueX, abs((int)(2 * rawViewport[1])) * MValueY);
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,10 @@
|
||||
// Preliminary non-working code.
|
||||
|
||||
#include "Globals.h"
|
||||
#include "GLInit.h"
|
||||
#include "Render.h"
|
||||
#include "TextureMngr.h"
|
||||
#include "VertexShaderManager.h"
|
||||
#include "XFBConvert.h"
|
||||
|
||||
enum {
|
||||
@ -29,39 +31,138 @@ enum {
|
||||
};
|
||||
|
||||
static GLuint xfb_texture;
|
||||
static u8 *xfb_buffer;
|
||||
static u8 *xfb_buffer = 0;
|
||||
static u8 *efb_buffer = 0;
|
||||
static GLuint s_xfbFrameBuffer = 0;
|
||||
static GLuint s_xfbRenderBuffer = 0;
|
||||
|
||||
void XFB_Init()
|
||||
{
|
||||
// used to render XFB
|
||||
xfb_buffer = new u8[XFB_WIDTH * XFB_HEIGHT * 4];
|
||||
memset(xfb_buffer, 0, XFB_WIDTH * XFB_HEIGHT * 4);
|
||||
glGenTextures(1, &xfb_texture);
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, xfb_texture);
|
||||
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, XFB_WIDTH, XFB_HEIGHT, 0, GL_BGRA, GL_UNSIGNED_BYTE, xfb_buffer);
|
||||
|
||||
// used to render EFB
|
||||
glGenFramebuffersEXT( 1, &s_xfbFrameBuffer);
|
||||
glGenRenderbuffersEXT(1, &s_xfbRenderBuffer);
|
||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, s_xfbRenderBuffer);
|
||||
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA, nBackbufferWidth, nBackbufferHeight);
|
||||
|
||||
efb_buffer = new u8[nBackbufferWidth * nBackbufferHeight * 4];
|
||||
}
|
||||
|
||||
void XFB_Draw(u8 *xfb_in_ram)
|
||||
void XFB_Write(u8 *xfb_in_ram, const TRectangle& sourceRc, u32 dstWd, u32 dstHt, float yScale)
|
||||
{
|
||||
Renderer::SetRenderMode(Renderer::RM_Normal);
|
||||
|
||||
Renderer::ResetGLState();
|
||||
ConvertXFB((u32 *)xfb_buffer, xfb_in_ram, XFB_WIDTH, XFB_HEIGHT);
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, xfb_texture);
|
||||
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, XFB_WIDTH, XFB_HEIGHT, 0, GL_BGRA, GL_UNSIGNED_BYTE, xfb_buffer);
|
||||
|
||||
// switch to XFB frame buffer
|
||||
Renderer::SetFramebuffer(s_xfbFrameBuffer);
|
||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, s_xfbRenderBuffer);
|
||||
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, s_xfbRenderBuffer);
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
glViewport(nXoff, nYoff, nBackbufferWidth, nBackbufferHeight);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, Renderer::GetRenderTarget());
|
||||
TextureMngr::EnableTexRECT(0);
|
||||
for (int i = 1; i < 8; ++i)
|
||||
TextureMngr::DisableStage(i);
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
float scaledTextureY = nBackbufferHeight - (nBackbufferHeight / yScale);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(nBackbufferWidth, nBackbufferHeight); glVertex2f(-1,-1);
|
||||
glTexCoord2f(nBackbufferWidth, scaledTextureY); glVertex2f(-1,1);
|
||||
glTexCoord2f(0, scaledTextureY); glVertex2f(1,1);
|
||||
glTexCoord2f(0, nBackbufferHeight); glVertex2f(1,-1);
|
||||
glEnd();
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
int width = sourceRc.right - sourceRc.left;
|
||||
int height = sourceRc.bottom - sourceRc.top;
|
||||
glReadPixels(sourceRc.left, sourceRc.top, width, height, GL_RGBA, GL_UNSIGNED_BYTE, efb_buffer);
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
Renderer::SetFramebuffer(0);
|
||||
Renderer::RestoreGLState();
|
||||
VertexShaderMngr::SetViewportChanged();
|
||||
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);
|
||||
TextureMngr::DisableStage(0);
|
||||
|
||||
Renderer::RestoreGLState();
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
// TODO - verify that XFB pixel order. probably reverse of GL pixel order
|
||||
// TODO - use shader for conversion
|
||||
ConvertToXFB((u32 *)xfb_in_ram, efb_buffer, dstWd, dstHt);
|
||||
|
||||
// old way
|
||||
/*glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, Renderer::GetRenderTarget());
|
||||
TextureMngr::EnableTexRECT(0);
|
||||
|
||||
glGetTexImage(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, GL_UNSIGNED_BYTE, efb_buffer);
|
||||
|
||||
static u8 *efbEndAddress = efb_buffer + ((nBackbufferWidth * nBackbufferHeight) - 1) * 4;
|
||||
ConvertToXFBReverse((u32 *)xfb_in_ram, efbEndAddress, dstWd, dstHt);*/
|
||||
|
||||
}
|
||||
|
||||
void XFB_Draw(u8 *xfb_in_ram, u32 width, u32 height, s32 yOffset)
|
||||
{
|
||||
if(width == 0 || height == 0)
|
||||
return;
|
||||
|
||||
OpenGL_Update(); // just updates the render window position and the backbuffer size
|
||||
|
||||
Renderer::SetRenderMode(Renderer::RM_Normal);
|
||||
|
||||
// render to the real buffer now
|
||||
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 ); // switch to the backbuffer
|
||||
glViewport(nXoff, nYoff, nBackbufferWidth, nBackbufferHeight);
|
||||
|
||||
Renderer::ResetGLState();
|
||||
|
||||
// TODO - use shader for conversion
|
||||
ConvertFromXFB((u32 *)xfb_buffer, xfb_in_ram, width, height);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, xfb_texture);
|
||||
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, xfb_buffer);
|
||||
TextureMngr::EnableTexRECT(0);
|
||||
for (int i = 1; i < 8; ++i)
|
||||
TextureMngr::DisableStage(i);
|
||||
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0); glVertex2f(-1,-1);
|
||||
glTexCoord2f(0, XFB_WIDTH); glVertex2f(-1,1);
|
||||
glTexCoord2f(XFB_WIDTH, XFB_HEIGHT); glVertex2f(1,1);
|
||||
glTexCoord2f(XFB_WIDTH, 0); glVertex2f(1,-1);
|
||||
glTexCoord2f(width, height + yOffset); glVertex2f(-1,-1);
|
||||
glTexCoord2f(width, 0 + yOffset); glVertex2f(-1,1);
|
||||
glTexCoord2f(0, 0 + yOffset); glVertex2f(1,1);
|
||||
glTexCoord2f(0, height + yOffset); glVertex2f(1,-1);
|
||||
glEnd();
|
||||
|
||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);
|
||||
TextureMngr::DisableStage(0);
|
||||
|
||||
Renderer::SwapBuffers();
|
||||
|
||||
Renderer::RestoreGLState();
|
||||
GL_REPORT_ERRORD();
|
||||
}
|
||||
|
||||
void XFB_Shutdown()
|
||||
{
|
||||
glDeleteFramebuffersEXT(1, &s_xfbFrameBuffer);
|
||||
|
||||
glDeleteTextures(1, &xfb_texture);
|
||||
xfb_texture = 0;
|
||||
delete [] xfb_buffer;
|
||||
|
@ -18,8 +18,16 @@
|
||||
#ifndef _XFB_H
|
||||
#define _XFB_H
|
||||
|
||||
#include "TextureMngr.h"
|
||||
|
||||
void XFB_Init();
|
||||
void XFB_Draw(u8 *xfb_in_ram);
|
||||
|
||||
// write the EFB to the XFB
|
||||
void XFB_Write(u8 *xfb_in_ram, const TRectangle& sourceRc, u32 dstWd, u32 dstHt, float yScale);
|
||||
|
||||
// draw the XFB to the screen
|
||||
void XFB_Draw(u8 *xfb_in_ram, u32 width, u32 height, s32 yOffset);
|
||||
|
||||
void XFB_Shutdown();
|
||||
|
||||
#endif
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include "VertexLoader.h"
|
||||
#include "PixelShaderManager.h"
|
||||
#include "VertexShaderManager.h"
|
||||
#include "XFB.h"
|
||||
|
||||
#include "VideoState.h"
|
||||
#include "Debugger/Debugger.h" // for the CDebugger class
|
||||
|
||||
@ -298,8 +300,12 @@ BOOL Video_Screenshot(TCHAR* _szFilename)
|
||||
}
|
||||
|
||||
|
||||
void Video_UpdateXFB(u8* _pXFB, u32 _dwWidth, u32 _dwHeight)
|
||||
void Video_UpdateXFB(u8* _pXFB, u32 _dwWidth, u32 _dwHeight, s32 _dwYOffset)
|
||||
{
|
||||
if(g_Config.bUseXFB)
|
||||
{
|
||||
XFB_Draw(_pXFB, _dwWidth, _dwHeight, _dwYOffset);
|
||||
}
|
||||
}
|
||||
|
||||
void Video_AddMessage(const char* pstr, u32 milliseconds)
|
||||
|
Reference in New Issue
Block a user