EFB Reads are so slow in D3D that I think we need an option for it. Here it is.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4378 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-10-07 19:54:56 +00:00
parent bf595e31be
commit 9c45ac7e35
8 changed files with 29 additions and 12 deletions

View File

@ -16,6 +16,8 @@
// http://code.google.com/p/dolphin-emu/
#include <string.h>
#include "VideoConfig.h"
#include "Setup.h"
#include "MemoryUtil.h"
#include "Thread.h"
@ -131,7 +133,8 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
while (fifoStateRun)
{
video_initialize.pPeekMessages();
VideoFifo_CheckEFBAccess();
if (g_ActiveConfig.bEFBAccessEnable)
VideoFifo_CheckEFBAccess();
VideoFifo_CheckSwapRequest();
s_criticalFifo.Enter();

View File

@ -87,6 +87,7 @@ void VideoConfig::Load(const char *ini_file)
iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 3); // NOTE - this is x in (1 << x)
iniFile.Get("Enhancements", "PostProcessingShader", &sPostProcessingShader, "");
iniFile.Get("Hacks", "EFBAccessEnable", &bEFBAccessEnable, true);
iniFile.Get("Hacks", "EFBCopyDisable", &bEFBCopyDisable, 0);
iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);
iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToRAM, 0);

View File

@ -104,7 +104,8 @@ struct VideoConfig
bool bFreeLook;
// Hacks
bool bEFBCopyDisable;
bool bEFBAccessEnable;
bool bEFBCopyDisable; // should reverse polarity of this one :) true=disabled can be confusing
bool bEFBCopyDisableHotKey;
bool bHack;
bool bCopyEFBToRAM;

View File

@ -93,6 +93,7 @@ struct TabDirect3D : public W32Util::Tab
CheckDlgButton(hDlg, IDC_ASPECT_4_3, g_Config.bKeepAR43 ? TRUE : FALSE);
CheckDlgButton(hDlg, IDC_WIDESCREEN_HACK, g_Config.bWidescreenHack ? TRUE : FALSE);
CheckDlgButton(hDlg, IDC_SAFE_TEXTURE_CACHE, g_Config.bSafeTextureCache ? TRUE : FALSE);
CheckDlgButton(hDlg, IDC_EFB_ACCESS_ENABLE, g_Config.bEFBAccessEnable ? TRUE : FALSE);
}
void Command(HWND hDlg,WPARAM wParam)
@ -118,6 +119,9 @@ struct TabDirect3D : public W32Util::Tab
case IDC_SAFE_TEXTURE_CACHE:
g_Config.bSafeTextureCache = Button_GetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE)) == 0 ? false : true;
break;
case IDC_EFB_ACCESS_ENABLE:
g_Config.bEFBAccessEnable = Button_GetCheck(GetDlgItem(hDlg, IDC_EFB_ACCESS_ENABLE)) == 0 ? false : true;
break;
default:
break;
}

View File

@ -499,7 +499,8 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
val = ((float)((u16 *)drect.pBits)[0])/((float)0xFFFF);
break;
default:
val=0;
val = 0;
break;
};
// [0.0, 1.0] ==> [0, 0xFFFFFFFF]
z = ((u32)(val * 0xffffff));// 0xFFFFFFFF;

View File

@ -442,6 +442,9 @@ void VideoFifo_CheckEFBAccess()
u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y)
{
if (!g_ActiveConfig.bEFBAccessEnable)
return 0;
s_accessEFBArgs.type = type;
s_accessEFBArgs.x = x;
s_accessEFBArgs.y = y;

View File

@ -1227,6 +1227,8 @@
#define IDC_ASPECT_16_10 1037
#define IDC_SAFE_TEXTURE_CACHE 1037
#define psh15 0x040e
#define IDC_EFBACCESSENABLE 1038
#define IDC_EFB_ACCESS_ENABLE 1038
#define psh16 0x040f
#define _WIN32_WINDOWS 0x0410
#define chx1 0x0410
@ -1544,7 +1546,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1037
#define _APS_NEXT_CONTROL_VALUE 1039
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -27,28 +27,30 @@ BEGIN
LTEXT "Will not work correctly on older GPU:s.",IDC_STATIC,7,47,170,8
END
IDD_SETTINGS DIALOGEX 0, 0, 231, 194
IDD_SETTINGS DIALOGEX 0, 0, 244, 217
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "&Graphics card:",IDC_STATIC,7,9,61,8
COMBOBOX IDC_ADAPTER,68,7,156,84,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_ADAPTER,68,7,169,84,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "&Fullscreen",IDC_FULLSCREENENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,25,56,8
CONTROL "&V-Sync",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,38,141,8
CONTROL "&Render to main window",IDC_RENDER_TO_MAINWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,50,141,8
LTEXT "Full&screen resolution:",IDC_STATIC,7,98,69,8
COMBOBOX IDC_RESOLUTION,87,98,137,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_RESOLUTION,87,98,150,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "&Windowed resolution:",IDC_STATIC,7,117,74,8
COMBOBOX IDC_RESOLUTIONWINDOWED,87,116,137,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_RESOLUTIONWINDOWED,87,116,150,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Rotate windowed mode 90 degrees (for &Ikaruga)",IDC_CHECK1,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_DISABLED | WS_TABSTOP,87,132,137,17
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_DISABLED | WS_TABSTOP,87,132,150,17
LTEXT "&Anti-alias mode:",IDC_STATIC,7,157,61,8
COMBOBOX IDC_ANTIALIASMODE,68,155,156,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_ANTIALIASMODE,68,155,169,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "&Aspect Ratio:",IDC_STATIC,7,66,52,8
CONTROL "4:3",IDC_ASPECT_4_3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,66,59,11
CONTROL "16:9",IDC_ASPECT_16_9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,80,49,11
CONTROL "&Widescreen Hack",IDC_WIDESCREEN_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,128,81,73,10
CONTROL "&Safe Texture Cache",IDC_SAFE_TEXTURE_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,172,85,11
CONTROL "&Enable CPU->EFB access (can cause slowdowns, enables pull stars in SMG and lens flare in Zeldas)",IDC_EFB_ACCESS_ENABLE,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,68,187,169,23
END
IDD_DEBUGGER DIALOGEX 0, 0, 234, 254
@ -114,13 +116,13 @@ BEGIN
IDD_SETTINGS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 224
RIGHTMARGIN, 237
VERTGUIDE, 7
VERTGUIDE, 68
VERTGUIDE, 81
VERTGUIDE, 87
TOPMARGIN, 7
BOTTOMMARGIN, 187
BOTTOMMARGIN, 210
END
IDD_DEBUGGER, DIALOG