Skip to content

Commit

Permalink
Merge pull request #19759 from hrydgard/enable-depth-raster
Browse files Browse the repository at this point in the history
Enable software depth raster for Wipeout, Midnight Club LA, Resistance.
  • Loading branch information
hrydgard authored Dec 22, 2024
2 parents fed54f6 + 03f09ae commit 7d4eddd
Show file tree
Hide file tree
Showing 51 changed files with 205 additions and 36 deletions.
1 change: 1 addition & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ static const ConfigSetting graphicsSettings[] = {
ConfigSetting("UseGeometryShader", &g_Config.bUseGeometryShader, false, CfgFlag::PER_GAME),
ConfigSetting("SkipBufferEffects", &g_Config.bSkipBufferEffects, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("DisableRangeCulling", &g_Config.bDisableRangeCulling, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("DepthRasterMode", &g_Config.iDepthRasterMode, 0, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("SoftwareRenderer", &g_Config.bSoftwareRendering, false, CfgFlag::PER_GAME),
ConfigSetting("SoftwareRendererJit", &g_Config.bSoftwareRenderingJit, true, CfgFlag::PER_GAME),
ConfigSetting("HardwareTransform", &g_Config.bHardwareTransform, true, CfgFlag::PER_GAME | CfgFlag::REPORT),
Expand Down
1 change: 1 addition & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ struct Config {
// Speedhacks (more will be moved here):
bool bSkipBufferEffects;
bool bDisableRangeCulling;
int iDepthRasterMode;

int iTexFiltering; // 1 = auto , 2 = nearest , 3 = linear , 4 = auto max quality
bool bSmart2DTexFiltering;
Expand Down
7 changes: 7 additions & 0 deletions Core/ConfigValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ enum class GPUBackend {
VULKAN = 3,
};

enum class DepthRasterMode {
DEFAULT = 0,
LOW_QUALITY = 1,
OFF = 2,
FORCE_ON = 3,
};

enum class RestoreSettingsBits : int {
SETTINGS = 1,
CONTROLS = 2,
Expand Down
18 changes: 14 additions & 4 deletions GPU/Common/DrawEngineCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@ DrawEngineCommon::DrawEngineCommon() : decoderMap_(32) {
decIndex_ = (u16 *)AllocateMemoryPages(DECODED_INDEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
indexGen.Setup(decIndex_);

useDepthRaster_ = PSP_CoreParameter().compat.flags().SoftwareRasterDepth;
if (useDepthRaster_) {
depthTransformed_ = (float *)AllocateMemoryPages(DEPTH_TRANSFORMED_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
depthScreenVerts_ = (int *)AllocateMemoryPages(DEPTH_SCREENVERTS_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
switch ((DepthRasterMode)g_Config.iDepthRasterMode) {
case DepthRasterMode::DEFAULT:
case DepthRasterMode::LOW_QUALITY:
useDepthRaster_ = PSP_CoreParameter().compat.flags().SoftwareRasterDepth;
break;
case DepthRasterMode::FORCE_ON:
useDepthRaster_ = true;
break;
case DepthRasterMode::OFF:
useDepthRaster_ = false;
}
}

Expand Down Expand Up @@ -779,6 +785,10 @@ bool DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti

void DrawEngineCommon::BeginFrame() {
applySkinInDecode_ = g_Config.bSoftwareSkinning;
if (!depthTransformed_ && useDepthRaster_) {
depthTransformed_ = (float *)AllocateMemoryPages(DEPTH_TRANSFORMED_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
depthScreenVerts_ = (int *)AllocateMemoryPages(DEPTH_SCREENVERTS_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
}
}

void DrawEngineCommon::DecodeVerts(VertexDecoder *dec, u8 *dest) {
Expand Down
16 changes: 8 additions & 8 deletions Tools/langtool/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
PopupMultiChoice *skipGPUReadbacks = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iSkipGPUReadbackMode, gr->T("Skip GPU Readbacks"), skipGpuReadbackModes, 0, ARRAY_SIZE(skipGpuReadbackModes), I18NCat::GRAPHICS, screenManager()));
skipGPUReadbacks->SetDisabledPtr(&g_Config.bSoftwareRendering);

static const char *depthRasterModes[] = { "Auto (default)", "Low", "Off", "Always on" };

PopupMultiChoice *depthRasterMode = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iDepthRasterMode, gr->T("Lens flare occlusion"), depthRasterModes, 0, ARRAY_SIZE(depthRasterModes), I18NCat::GRAPHICS, screenManager()));
depthRasterMode->SetDisabledPtr(&g_Config.bSoftwareRendering);

CheckBox *texBackoff = graphicsSettings->Add(new CheckBox(&g_Config.bTextureBackoffCache, gr->T("Lazy texture caching", "Lazy texture caching (speedup)")));
texBackoff->SetDisabledPtr(&g_Config.bSoftwareRendering);
texBackoff->OnClick.Add([=](EventParams& e) {
Expand Down
33 changes: 23 additions & 10 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1228,16 +1228,7 @@ ULJS19067 = true
ULAS42247 = true
ULAS42318 = true

[SoftwareRasterDepth]

[DisableFirstFrameReadback]
# Wipeout Pure
UCUS98612 = true
UCJS10007 = true
UCES00001 = true
UCKS45008 = true
NPJG00059 = true

# SOCOM: Fireteam Bravo 3 (see issue #18958, hopefully fixes crash in Stockpile mission, #10461)
UCES-01242 = true
NPJG-00035 = true
Expand Down Expand Up @@ -1644,7 +1635,15 @@ ULJM05037 = true
ULJM05216 = true
NPJH50181 = true

[ReadbackDepth]
[SoftwareRasterDepth]
# Midnight Club: LA Remix
ULUS10383 = true
ULES01144 = true
ULJS00180 = true
ULJS00267 = true
ULJM05904 = true
NPJH50440 = true

# Syphon Filter - Dark Mirror
UCES00310 = true
UCUS98641 = true
Expand All @@ -1664,6 +1663,20 @@ SYPH04036 = true # Prototype?
NPUG80114 = true
NPEG00004 = true

# Wipeout Pure
UCUS98612 = true
UCJS10007 = true
UCES00001 = true
UCKS45008 = true
NPJG00059 = true

# Resistance Retribution (needs testing)
UCES01184 = true
UCUS98668 = true
UCJP00174 = true

[ReadbackDepth]

[BlockTransferDepth]
# Iron Man - see issue #16530
# Note that this option also requires IntraVRAMBlockTransferAllowCreateFB.
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/ar_AE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = ‎عنيف
Alternative Speed = سرعة ثانوية (في %, 0 = ‎غير محدود)
Alternative Speed 2 = Alternative speed 2 (in %, 0 = unlimited)
Always on = Always on
Anisotropic Filtering = ‎فلتر الحواف
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = ‎تلقائي
Auto = ‎تلقائي
Auto (1:1) = ‎تلقائي (1:1)
Auto FrameSkip = ‎تخطي الإطار التلقائي
Expand Down Expand Up @@ -648,6 +650,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Internal resolution
Lazy texture caching = Lazy texture caching (speedup)
Lazy texture caching Tip = Faster, but can cause text problems in a few games
Lens flare occlusion = Lens flare occlusion
Linear = ‎خطي
Low = ‎منخفض
LowCurves = Spline/Bezier curves quality
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/az_AZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Aggressive
Alternative Speed = Alternative speed (in %, 0 = unlimited)
Alternative Speed 2 = Alternative speed 2 (in %, 0 = unlimited)
Always on = Always on
Anisotropic Filtering = Anisotropic filtering
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Auto (default)
Auto = Auto
Auto (1:1) = Auto (1:1)
Auto FrameSkip = Auto frameskip
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Internal resolution
Lazy texture caching = Lazy texture caching (speedup)
Lazy texture caching Tip = Faster, but can cause text problems in a few games
Lens flare occlusion = Lens flare occlusion
Linear = Linear
Low = Low
LowCurves = Spline/Bezier curves quality
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/bg_BG.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Aggressive
Alternative Speed = Алтернативна скорост
Alternative Speed 2 = Alternative speed 2 (in %, 0 = unlimited)
Always on = Always on
Anisotropic Filtering = Anisotropic филтриране
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Автоматично
Auto = Автоматично
Auto (1:1) = Автоматично (1:1)
Auto FrameSkip = Автоматично пропускане на кадри
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Вътрешна резолюция
Lazy texture caching = Мързеливо текстурно кеширане (ускорява)
Lazy texture caching Tip = Faster, but can cause text problems in a few games
Lens flare occlusion = Lens flare occlusion
Linear = Линеарно
Low = Low
LowCurves = Ниско качествени splines и bezier извивки (ускорява)
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/ca_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Agressiu
Alternative Speed = Velocitat alternativa (%, 0 = il·limitada)
Alternative Speed 2 = Velocitat alternativa 2 (%, 0 = il·limitada)
Always on = Always on
Anisotropic Filtering = Filtrat anisotròpic
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Automàtic
Auto = Automàtic
Auto (1:1) = Automàtic (1:1)
Auto FrameSkip = Salt de quadres automàtic
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Resolució interna
Lazy texture caching = Memòria cau de textures diferit (ràpid)
Lazy texture caching Tip = Ràpid, però puc provocar problemes als textos d'alguns jocs
Lens flare occlusion = Lens flare occlusion
Linear = Lineal
Low = Baixa
LowCurves = Qualitat de corbes Bézier
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/cz_CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Agresivní
Alternative Speed = Alternativní rychlost (v %, 0 = neomezeno)
Alternative Speed 2 = Alternative speed 2 (in %, 0 = unlimited)
Always on = Always on
Anisotropic Filtering = Anizotropní filtrování
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Automaticky
Auto = Automaticky
Auto (1:1) = Automatické (1:1)
Auto FrameSkip = Automatické přeskakování snímků
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Vnitřní rozlišení
Lazy texture caching = Líné ukládání textur do mezipaměti (zrychlení)
Lazy texture caching Tip = Faster, but can cause text problems in a few games
Lens flare occlusion = Lens flare occlusion
Linear = Lineární
Low = Nízké
LowCurves = Kvalita křivek/Beziérových křivek
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/da_DK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Aggressiv
Alternative Speed = Alternativ hastighed (i %, 0 = ubegrænset)
Alternative Speed 2 = Alternative speed 2 (in %, 0 = unlimited)
Always on = Always on
Anisotropic Filtering = Anisotropisk filtrering
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Automatisk
Auto = Automatisk
Auto (1:1) = Automatisk (1:1)
Auto FrameSkip = Automatisk frameskip
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Intern opløsning
Lazy texture caching = Træg textur caching (hurtigere)
Lazy texture caching Tip = Faster, but can cause text problems in a few games
Lens flare occlusion = Lens flare occlusion
Linear = Lineær
Low = Lav
LowCurves = Simple spline og bezier-kurver (hurtigere)
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/de_DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Aggressiv
Alternative Speed = Alternative Geschwindigkeit
Alternative Speed 2 = Alternative Geschwindigkeit 2 (in %, 0 = unlimitiert)
Always on = Always on
Anisotropic Filtering = Anisotropischer Filter
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Automatisch
Auto = Automatisch
Auto (1:1) = Automatisch (1:1)
Auto FrameSkip = Autom. Bilder überspringen
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Interne Auflösung
Lazy texture caching = Träges Textur-Caching (schneller)
Lazy texture caching Tip = Faster, but can cause text problems in a few games
Lens flare occlusion = Lens flare occlusion
Linear = Linear
Low = Niedrig
LowCurves = Bezierkurven Qualität
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/dr_ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Aggressive
Alternative Speed = Lassi to leko'napa
Alternative Speed 2 = Alternative speed 2 (in %, 0 = unlimited)
Always on = Always on
Anisotropic Filtering = Panyaring Anisotropic
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Ia mesa
Auto = Ia mesa
Auto (1:1) = Auto (1:1)
Auto FrameSkip = Auto frameskip
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Internal resolution
Lazy texture caching = Lazy texture caching (speedup)
Lazy texture caching Tip = Faster, but can cause text problems in a few games
Lens flare occlusion = Lens flare occlusion
Linear = Maruruh
Low = Low
LowCurves = Spline/Bezier curves quality
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/en_US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Aggressive
Alternative Speed = Alternative speed (in %, 0 = unlimited)
Alternative Speed 2 = Alternative speed 2 (in %, 0 = unlimited)
Always on = Always on
Anisotropic Filtering = Anisotropic filtering
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Auto (default)
Auto = Auto
Auto (1:1) = Auto (1:1)
Auto FrameSkip = Auto frameskip
Expand Down Expand Up @@ -664,6 +666,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Internal resolution
Lazy texture caching = Lazy texture caching (speedup)
Lazy texture caching Tip = Faster, but can cause text problems in a few games
Lens flare occlusion = Lens flare occlusion
Linear = Linear
Low = Low
LowCurves = Spline/Bezier curves quality
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/es_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = AdrenoTools driver manager
Aggressive = Agresivo
Alternative Speed = Velocidad alternativa (%, 0 = ilimitada)
Alternative Speed 2 = Velocidad alternativa 2 (%, 0 = ilimitada)
Always on = Always on
Anisotropic Filtering = Filtrado anisotrópico
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Relación de aspecto
Auto (default) = Automático
Auto = Automático
Auto (1:1) = Automático (1:1)
Auto FrameSkip = Salto de cuadros automático
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Factor de escala entero
Internal Resolution = Resolución interna
Lazy texture caching = Caché de texturas diferido (rápido)
Lazy texture caching Tip = Rápido, pero puedo provocar problemas en los textos de algunos juegos
Lens flare occlusion = Lens flare occlusion
Linear = Lineal
Low = Baja
LowCurves = Calidad de curvas Bézier
Expand Down
3 changes: 3 additions & 0 deletions assets/lang/es_LA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ AdrenoTools driver manager = Administrador de controladores AdrenoTools(masculin
Aggressive = Agresivo
Alternative Speed = Velocidad alternativa (en %, 0 = ilimitada)
Alternative Speed 2 = Velocidad alternativa 2 (en %, 0 = ilimitada)
Always on = Always on
Anisotropic Filtering = Filtrado Anisotrópico
Antialiasing (MSAA) = Antialiasing (MSAA)
Aspect Ratio = Aspect Ratio
Auto (default) = Automático
Auto = Automático
Auto (1:1) = Automático (1:1)
Auto FrameSkip = Salto de cuadros automático
Expand Down Expand Up @@ -640,6 +642,7 @@ Integer scale factor = Integer scale factor
Internal Resolution = Resolución interna
Lazy texture caching = Caché de texturas diferido (rápido)
Lazy texture caching Tip = Más rápido, pero puede causar problemas de texto en algunos juegos.
Lens flare occlusion = Lens flare occlusion
Linear = Lineal
Low = Baja
LowCurves = Calidad de curvas bézier/Spline
Expand Down
Loading

0 comments on commit 7d4eddd

Please sign in to comment.