diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index 8af3dff615..9fb9086238 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -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 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 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 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."); @@ -517,6 +518,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con 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, _("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")); group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5); diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 44f6964cfb..29913559c6 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -379,7 +379,7 @@ static void BPWritten(const BPCmd& bp) u8 offset = bp.address & 2; 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 + 1, bp.newvalue >> 10); diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp index 102e17db34..1454d88ca0 100644 --- a/Source/Core/VideoCommon/MainBase.cpp +++ b/Source/Core/VideoCommon/MainBase.cpp @@ -152,7 +152,7 @@ u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type) 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]; SyncGPU(SYNC_GPU_BBOX); diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index f3db81fbf4..90c80136c2 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -277,7 +277,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T out.Write("};\n"); } - if (g_ActiveConfig.backend_info.bSupportsBBox) + if (g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable) { 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"); } - if (g_ActiveConfig.backend_info.bSupportsBBox && BoundingBox::active) + if (g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable && BoundingBox::active) { uid_data->bounding_box = true; const char* atomic_op = ApiType == API_OPENGL ? "atomic" : "Interlocked"; diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 49b6d23e1a..8e5c73b6a0 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -88,7 +88,7 @@ void VertexLoader::CompileVertexTranslator() m_numPipelineStages = 0; // 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); // Colors @@ -299,7 +299,7 @@ void VertexLoader::CompileVertexTranslator() } // Update the bounding box - if (!g_ActiveConfig.backend_info.bSupportsBBox) + if (!g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable) WriteCall(BoundingBox::Update); // 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; // 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); for (int s = 0; s < count; s++) diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 5201f13ba7..b8044bd880 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -97,6 +97,7 @@ void VideoConfig::Load(const std::string& ini_file) IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks"); hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true); + hacks->Get("BBoxEnable", &bBBoxEnable, false); hacks->Get("EFBToTextureEnable", &bSkipEFBCopyToRam, true); hacks->Get("EFBScaledCopy", &bCopyEFBScaled, true); hacks->Get("EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false); @@ -196,6 +197,7 @@ void VideoConfig::GameIniLoad() CHECK_SETTING("Video_Stereoscopy", "StereoConvergenceMinimum", iStereoConvergenceMinimum); CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable); + CHECK_SETTING("Video_Hacks", "BBoxEnable", bBBoxEnable); CHECK_SETTING("Video_Hacks", "EFBToTextureEnable", bSkipEFBCopyToRam); CHECK_SETTING("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled); CHECK_SETTING("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges); @@ -283,6 +285,7 @@ void VideoConfig::Save(const std::string& ini_file) IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks"); hacks->Set("EFBAccessEnable", bEFBAccessEnable); + hacks->Set("BBoxEnable", bBBoxEnable); hacks->Set("EFBToTextureEnable", bSkipEFBCopyToRam); hacks->Set("EFBScaledCopy", bCopyEFBScaled); hacks->Set("EFBEmulateFormatChanges", bEFBEmulateFormatChanges); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index b0f133e759..37eeb50101 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -112,6 +112,7 @@ struct VideoConfig final // Hacks bool bEFBAccessEnable; bool bPerfQueriesEnable; + bool bBBoxEnable; bool bEFBEmulateFormatChanges; bool bSkipEFBCopyToRam;