VideoCommon: Make BBox emulation optional

This commit is contained in:
degasus 2015-04-06 02:17:57 +02:00
parent ac0e304159
commit acd074e291
7 changed files with 13 additions and 7 deletions

View File

@ -110,6 +110,7 @@ static wxString aa_desc = _("Reduces the amount of aliasing caused by rasterizin
static wxString scaled_efb_copy_desc = _("Greatly increases quality of textures generated using render-to-texture effects.\nRaising the internal resolution will improve the effect of this setting.\nSlightly increases GPU load and causes relatively few graphical issues.\n\nIf unsure, leave this checked."); static wxString scaled_efb_copy_desc = _("Greatly increases quality of textures generated using render-to-texture effects.\nRaising the internal resolution will improve the effect of this setting.\nSlightly increases GPU load and causes relatively few graphical issues.\n\nIf unsure, leave this checked.");
static wxString pixel_lighting_desc = _("Calculates lighting of 3D objects per-pixel rather than per-vertex, smoothing out the appearance of lit polygons and making individual triangles less noticeable.\nRarely causes slowdowns or graphical issues.\n\nIf unsure, leave this unchecked."); static wxString pixel_lighting_desc = _("Calculates lighting of 3D objects per-pixel rather than per-vertex, smoothing out the appearance of lit polygons and making individual triangles less noticeable.\nRarely causes slowdowns or graphical issues.\n\nIf unsure, leave this unchecked.");
static wxString fast_depth_calc_desc = _("Use a less accurate algorithm to calculate depth values.\nCauses issues in a few games, but can give a decent speedup depending on the game and/or your GPU.\n\nIf unsure, leave this checked."); static wxString fast_depth_calc_desc = _("Use a less accurate algorithm to calculate depth values.\nCauses issues in a few games, but can give a decent speedup depending on the game and/or your GPU.\n\nIf unsure, leave this checked.");
static wxString disable_bbox_desc = _("Disable the bounding box emulation.\nThis may improve the GPU performance a lot, but some games will break.\n\nIf unsure, leave this checked.");
static wxString force_filtering_desc = _("Filter all textures, including any that the game explicitly set as unfiltered.\nMay improve quality of certain textures in some games, but will cause issues in others.\nOn Direct3D, setting Anisotropic Filtering above 1x will also have the same effect as enabling this option.\n\nIf unsure, leave this unchecked."); static wxString force_filtering_desc = _("Filter all textures, including any that the game explicitly set as unfiltered.\nMay improve quality of certain textures in some games, but will cause issues in others.\nOn Direct3D, setting Anisotropic Filtering above 1x will also have the same effect as enabling this option.\n\nIf unsure, leave this unchecked.");
static wxString borderless_fullscreen_desc = _("Implement fullscreen mode with a borderless window spanning the whole screen instead of using exclusive mode.\nAllows for faster transitions between fullscreen and windowed mode, but slightly increases input latency, makes movement less smooth and slightly decreases performance.\nExclusive mode is required for Nvidia 3D Vision to work in the Direct3D backend.\n\nIf unsure, leave this unchecked."); static wxString borderless_fullscreen_desc = _("Implement fullscreen mode with a borderless window spanning the whole screen instead of using exclusive mode.\nAllows for faster transitions between fullscreen and windowed mode, but slightly increases input latency, makes movement less smooth and slightly decreases performance.\nExclusive mode is required for Nvidia 3D Vision to work in the Direct3D backend.\n\nIf unsure, leave this unchecked.");
static wxString internal_res_desc = _("Specifies the resolution used to render at. A high resolution greatly improves visual quality, but also greatly increases GPU load and can cause issues in certain games.\n\"Multiple of 640x528\" will result in a size slightly larger than \"Window Size\" but yield fewer issues. Generally speaking, the lower the internal resolution is, the better your performance will be.\n\nIf unsure, select 640x528."); static wxString internal_res_desc = _("Specifies the resolution used to render at. A high resolution greatly improves visual quality, but also greatly increases GPU load and can cause issues in certain games.\n\"Multiple of 640x528\" will result in a size slightly larger than \"Window Size\" but yield fewer issues. Generally speaking, the lower the internal resolution is, the better your performance will be.\n\nIf unsure, select 640x528.");
@ -517,6 +518,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
wxGridSizer* const szr_other = new wxGridSizer(2, 5, 5); wxGridSizer* const szr_other = new wxGridSizer(2, 5, 5);
szr_other->Add(CreateCheckBox(page_hacks, _("Disable Destination Alpha"), disable_dstalpha_desc, vconfig.bDstAlphaPass)); szr_other->Add(CreateCheckBox(page_hacks, _("Disable Destination Alpha"), disable_dstalpha_desc, vconfig.bDstAlphaPass));
szr_other->Add(CreateCheckBox(page_hacks, _("Fast Depth Calculation"), fast_depth_calc_desc, vconfig.bFastDepthCalc)); szr_other->Add(CreateCheckBox(page_hacks, _("Fast Depth Calculation"), fast_depth_calc_desc, vconfig.bFastDepthCalc));
szr_other->Add(CreateCheckBox(page_hacks, _("Disable Bounding Box"), disable_bbox_desc, vconfig.bBBoxEnable, true));
wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Other")); wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Other"));
group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5); group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);

View File

@ -379,7 +379,7 @@ static void BPWritten(const BPCmd& bp)
u8 offset = bp.address & 2; u8 offset = bp.address & 2;
BoundingBox::active = true; BoundingBox::active = true;
if (g_ActiveConfig.backend_info.bSupportsBBox) if (g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable)
{ {
g_renderer->BBoxWrite(offset, bp.newvalue & 0x3ff); g_renderer->BBoxWrite(offset, bp.newvalue & 0x3ff);
g_renderer->BBoxWrite(offset + 1, bp.newvalue >> 10); g_renderer->BBoxWrite(offset + 1, bp.newvalue >> 10);

View File

@ -152,7 +152,7 @@ u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type)
u16 VideoBackendHardware::Video_GetBoundingBox(int index) u16 VideoBackendHardware::Video_GetBoundingBox(int index)
{ {
if (!g_ActiveConfig.backend_info.bSupportsBBox) if (!g_ActiveConfig.backend_info.bSupportsBBox || !g_ActiveConfig.bBBoxEnable)
return BoundingBox::coords[index]; return BoundingBox::coords[index];
SyncGPU(SYNC_GPU_BBOX); SyncGPU(SYNC_GPU_BBOX);

View File

@ -277,7 +277,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
out.Write("};\n"); out.Write("};\n");
} }
if (g_ActiveConfig.backend_info.bSupportsBBox) if (g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable)
{ {
if (ApiType == API_OPENGL) if (ApiType == API_OPENGL)
{ {
@ -641,7 +641,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
out.Write("\tocol0.a = float(" I_ALPHA".a) / 255.0;\n"); out.Write("\tocol0.a = float(" I_ALPHA".a) / 255.0;\n");
} }
if (g_ActiveConfig.backend_info.bSupportsBBox && BoundingBox::active) if (g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable && BoundingBox::active)
{ {
uid_data->bounding_box = true; uid_data->bounding_box = true;
const char* atomic_op = ApiType == API_OPENGL ? "atomic" : "Interlocked"; const char* atomic_op = ApiType == API_OPENGL ? "atomic" : "Interlocked";

View File

@ -88,7 +88,7 @@ void VertexLoader::CompileVertexTranslator()
m_numPipelineStages = 0; m_numPipelineStages = 0;
// Get the pointer to this vertex's buffer data for the bounding box // Get the pointer to this vertex's buffer data for the bounding box
if (!g_ActiveConfig.backend_info.bSupportsBBox) if (!g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable)
WriteCall(BoundingBox::SetVertexBufferPosition); WriteCall(BoundingBox::SetVertexBufferPosition);
// Colors // Colors
@ -299,7 +299,7 @@ void VertexLoader::CompileVertexTranslator()
} }
// Update the bounding box // Update the bounding box
if (!g_ActiveConfig.backend_info.bSupportsBBox) if (!g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable)
WriteCall(BoundingBox::Update); WriteCall(BoundingBox::Update);
// indexed position formats may skip a the vertex // indexed position formats may skip a the vertex
@ -326,7 +326,7 @@ int VertexLoader::RunVertices(DataReader src, DataReader dst, int count, int pri
m_skippedVertices = 0; m_skippedVertices = 0;
// Prepare bounding box // Prepare bounding box
if (!g_ActiveConfig.backend_info.bSupportsBBox) if (!g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable)
BoundingBox::Prepare(m_vat, primitive, m_VtxDesc, m_native_vtx_decl); BoundingBox::Prepare(m_vat, primitive, m_VtxDesc, m_native_vtx_decl);
for (int s = 0; s < count; s++) for (int s = 0; s < count; s++)

View File

@ -97,6 +97,7 @@ void VideoConfig::Load(const std::string& ini_file)
IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks"); IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true); hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true);
hacks->Get("BBoxEnable", &bBBoxEnable, false);
hacks->Get("EFBToTextureEnable", &bSkipEFBCopyToRam, true); hacks->Get("EFBToTextureEnable", &bSkipEFBCopyToRam, true);
hacks->Get("EFBScaledCopy", &bCopyEFBScaled, true); hacks->Get("EFBScaledCopy", &bCopyEFBScaled, true);
hacks->Get("EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false); hacks->Get("EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false);
@ -196,6 +197,7 @@ void VideoConfig::GameIniLoad()
CHECK_SETTING("Video_Stereoscopy", "StereoConvergenceMinimum", iStereoConvergenceMinimum); CHECK_SETTING("Video_Stereoscopy", "StereoConvergenceMinimum", iStereoConvergenceMinimum);
CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable); CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable);
CHECK_SETTING("Video_Hacks", "BBoxEnable", bBBoxEnable);
CHECK_SETTING("Video_Hacks", "EFBToTextureEnable", bSkipEFBCopyToRam); CHECK_SETTING("Video_Hacks", "EFBToTextureEnable", bSkipEFBCopyToRam);
CHECK_SETTING("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled); CHECK_SETTING("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled);
CHECK_SETTING("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges); CHECK_SETTING("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
@ -283,6 +285,7 @@ void VideoConfig::Save(const std::string& ini_file)
IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks"); IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
hacks->Set("EFBAccessEnable", bEFBAccessEnable); hacks->Set("EFBAccessEnable", bEFBAccessEnable);
hacks->Set("BBoxEnable", bBBoxEnable);
hacks->Set("EFBToTextureEnable", bSkipEFBCopyToRam); hacks->Set("EFBToTextureEnable", bSkipEFBCopyToRam);
hacks->Set("EFBScaledCopy", bCopyEFBScaled); hacks->Set("EFBScaledCopy", bCopyEFBScaled);
hacks->Set("EFBEmulateFormatChanges", bEFBEmulateFormatChanges); hacks->Set("EFBEmulateFormatChanges", bEFBEmulateFormatChanges);

View File

@ -112,6 +112,7 @@ struct VideoConfig final
// Hacks // Hacks
bool bEFBAccessEnable; bool bEFBAccessEnable;
bool bPerfQueriesEnable; bool bPerfQueriesEnable;
bool bBBoxEnable;
bool bEFBEmulateFormatChanges; bool bEFBEmulateFormatChanges;
bool bSkipEFBCopyToRam; bool bSkipEFBCopyToRam;