diff options
| author | degasus <wickmarkus@web.de> | 2015-04-06 02:17:57 +0200 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2015-05-25 09:33:34 +0200 |
| commit | acd074e291d287080031d7295baa6e2f7862440f (patch) | |
| tree | 8e4d38caf103282d5a2ae38ca8357168b70c4fe6 /Source/Core/VideoCommon | |
| parent | ac0e3041599429f271d6fddc284ec3e4753c0cd3 (diff) | |
VideoCommon: Make BBox emulation optional
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/BPStructs.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/MainBase.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoader.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.cpp | 3 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.h | 1 |
6 files changed, 11 insertions, 7 deletions
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; |
