added an option to copy textures from the EFB to system memory. this is slower but shouldn't cause the compatibility issues the previous method of copying them directly to a GL texture has. the new method can be tested by disabling "copy EFB to texture" in the hacks section. the new method still needs some tweaks.

fixed some off-by-one errors in the EFB to texture copy and the scissor box. also fixed a couple asserts I was getting in the volume directory stuff.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1853 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
donkopunchstania
2009-01-11 22:25:57 +00:00
parent 394b040f61
commit d6e8c1f5d0
15 changed files with 928 additions and 57 deletions

View File

@ -30,6 +30,7 @@
#include "OpcodeDecoding.h"
#include "TextureMngr.h"
#include "TextureDecoder.h"
#include "TextureConverter.h"
#include "VertexShaderManager.h"
#include "PixelShaderManager.h"
#include "XFB.h"
@ -431,8 +432,8 @@ void BPWritten(int addr, int changes, int newval)
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))
};
float MValueX = OpenGL_GetXmax();
float MValueY = OpenGL_GetYmax();
@ -449,16 +450,21 @@ void BPWritten(int addr, int changes, int newval)
PE_copy.Hex = bpmem.triggerEFBCopy;
if (PE_copy.copy_to_xfb == 0) {
if(g_Config.bEFBToTextureDisable) {
// EFB to texture
// for some reason it sets bpmem.zcontrol.pixel_format to PIXELFMT_Z24 every time a zbuffer format is given as a dest to GXSetTexCopyDst
if (g_Config.bEFBCopyDisable) {
glViewport(rc.left,rc.bottom,rc.right,rc.top);
glScissor(rc.left,rc.bottom,rc.right,rc.top);
}
else
// EFB to texture
// for some reason it sets bpmem.zcontrol.pixel_format to PIXELFMT_Z24 every time a zbuffer format is given as a dest to GXSetTexCopyDst
TextureMngr::CopyRenderTargetToTexture(bpmem.copyTexDest<<5, bpmem.zcontrol.pixel_format==PIXELFMT_Z24, PE_copy.intensity_fmt>0,
else if (g_Config.bEFBToTextureEnable) {
TextureMngr::CopyRenderTargetToTexture(bpmem.copyTexDest<<5, bpmem.zcontrol.pixel_format==PIXELFMT_Z24, PE_copy.intensity_fmt>0,
(PE_copy.target_pixel_format/2)+((PE_copy.target_pixel_format&1)*8), PE_copy.half_scale>0, &rc);
}
}
else {
TextureConverter::EncodeToRam(bpmem.copyTexDest<<5, bpmem.zcontrol.pixel_format==PIXELFMT_Z24, PE_copy.intensity_fmt>0,
(PE_copy.target_pixel_format/2)+((PE_copy.target_pixel_format&1)*8), PE_copy.half_scale>0, rc);
}
}
else {
// EFB to XFB
if (g_Config.bUseXFB)