mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
VideoCommon: Make BBox emulation optional
This commit is contained in:
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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";
|
||||
|
@ -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++)
|
||||
|
@ -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);
|
||||
|
@ -112,6 +112,7 @@ struct VideoConfig final
|
||||
// Hacks
|
||||
bool bEFBAccessEnable;
|
||||
bool bPerfQueriesEnable;
|
||||
bool bBBoxEnable;
|
||||
|
||||
bool bEFBEmulateFormatChanges;
|
||||
bool bSkipEFBCopyToRam;
|
||||
|
Reference in New Issue
Block a user