Repository navigation
Mafia: Definitive Edition: Add Luma mod - #225
Merged
Merged
Conversation
Owner
|
I'm adding SDR support to Luma this well, given this overall, I'll wait to merge my changes. Thanks. |
Removed HDR-related comments and settings that were not functional for the game. Updated swapchain upgrade settings to disable HDR output and prevent fullscreen state.
Restore the shared core definitions to the PR base. Mafia now skips Luma display composition and leaves the game output unchanged.
Use the same ProjectGuid in the vcxproj and Luma.sln.
Describe the DLAA-only output path and retain the reverse-engineering findings without requiring the raw shader disassembly dumps.
The raw SM5 disassembly is not used by the build or runtime. Its findings remain documented in REPORT.md.
The raw SM5 disassembly is not used by the build or runtime. Its findings remain documented in REPORT.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mafia: Definitive Edition: Add Luma mod
Adds a Luma mod for Mafia: Definitive Edition (the 2020 remake), replacing the game's temporal
resolve with DLSS (DLAA at native resolution). Same shape as the existing Mafia II: Definitive
Edition and Mafia III mods.
What it does
0x37B05605,0x7B9B914F) and feeds DLSS SR with the game'sown jittered colour (
t0), history (t1) and motion vectors (t2).0x121A4A96), the only full resolution pass that bothtests and writes depth.
#if DEVELOPMENT.Facts worth recording (all measured - REPORT.md carries the raw evidence)
t2is the MV (R16G16B16A16_FLOAT), stored in UV space, so it must be scaled by the render resolution before DLSS sees it.prevUV = curUV + MVwith no jitter term at all (disassembly confirmed); the shader never reads the jitter floats we hand to DLSS.MVJitteredis therefore set in the create flags, while the separate behaviour flag ships off - with DLSS 310.9.x, ON measures softer and noisier on this content (§6.2).cancel_second_taa, default on, left switchable so it can be A/B'd).0x747C6210mul r0, r0, v1outside itsif (strength > 0)block. Skipping the draw removes a per pixel multiply and turns the screen black. Tame it by zeroingcb0[0].zinstead.0x2B974E48is not the colour AAt0, a single channelR32_FLOATauxiliary buffer. Feeding that to DLSS is exactly what produced the early "heavy noise" reports. Deliberately not hooked.0x916B1D65- the same hash RenoDX uses, so independently confirmed by two projects.DLAA-only output
The mod follows the existing DLSS-only pattern:
swapchain_upgrade_type = Noneandforce_disable_display_composition = true. It skips Luma's HDR upgrade and final displaycomposition, leaving the game's output format and colour pipeline in control. It does not force SDR,
rewrite
DisplayMode, or apply a replacement SDR transfer function.The shared
SDR_OUTPUT_TRANSFORMsetting and shader logic have been removed. The shared displayshader's only remaining diff is the trailing newline added by GitHub's web editor. The game is also
allowed to choose fullscreen mode; Luma's forced flip-model upgrade remains disabled.
Verification
Original validation reported by the contributor:
Development-ReleaseandPublishing-Release, x64. The project shipsv145like therest of the repo.
the game's own, RCAS checked A/B in game, DLSS render presets profiled (§6.1).
AA Low -> Medium -> High -> Low and then a full cutscene, in one session (§6.5 / §6.6).
Follow-up output cleanup was checked statically: the remote game code, report and project file
match the prepared patch; the DLSS draw implementation is unchanged; the project GUID now matches
the solution. The core definitions are restored to the PR base and both raw disassembly dumps are
removed. This follow-up has not been rebuilt or tested in game.
Known limitations (REPORT.md §7)
(verified: every shader unique to those modes is a geometry pass), so there is no draw to replace.
Nothing on this side can change that.
100-190, no resolve, no tonemapper). There is nothing to anti-alias, and a video frame carries none
of the guides DLSS SR / RR / NR or frame generation need.
Mfor correct reflective / transparent content (§6.1).resolution costs more than the game's TAA.
Documentation
REPORT.mdin the game folder is both the user facing document (§1-§3: requirements, installation,settings) and the reverse engineering record (§4-§6: passes, measurements, raw evidence). The two raw
SM5 disassembly dumps are not required by the build or runtime and have been removed; their findings
remain in the report.