fix(video): match data-format 14 to format 13's number-type wildcard in GetTextureFormat - #860
Open
the-abraar wants to merge 1 commit into
Open
the-abraar wants to merge 1 commit into
the-abraar wants to merge 1 commit into
Conversation
…ureFormat GetTextureFormat wildcarded format 13 to any number type but only matched format 14 at number type 7, so a format-14 texture with any other number type fell through to the RGBA8 default instead of the 128-bit float format. TryDecodeRenderTargetFormat and the Metal backend's mirrored table both already treat 13 and 14 identically for every number type, so this was a one-line gap rather than an intentional difference.
📦 Build artifacts —
|
| Platform | Download |
|---|---|
| Windows (win-x64) | sharpemu-win-x64-4b90328 |
| Linux (linux-x64) | sharpemu-linux-x64-4b90328 |
| macOS (osx-x64) | sharpemu-osx-x64-4b90328 |
From build run #1724. Downloads require a GitHub login and expire after 90 days.
YoussefBenSlimene
added a commit
to YoussefBenSlimene/sharpemu
that referenced
this pull request
Sep 12, 2026
…uires GPU residency, format-14 wildcard (upstream sharpemu#853 sharpemu#860) Three upstream fixes for the black-screen class: 1. DCC fast clears now use SubmitOffscreenColorClear instead of RequestGuestColorClear — the latter never publishes _availableGuestImages, so later composites sampled empty CPU tiles 2. Texture upload skip requires IsGpuGuestImageAvailable — prevents sampling stale/empty GPU textures 3. GetTextureFormat format 14 wildcard: (14,7) -> (14,_) — format 14 textures with number types other than 4/5/7 fell through to R8G8B8A8Unorm instead of R32G32B32A32Sfloat Mortal Shell: 1x1 placeholder count reduced from 5+ to 1; draws at seq=67k
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.
Before submitting
Please read our contribution guidelines before opening a pull request:
➡️ CONTRIBUTING.md
By opening this pull request, you confirm that you have read and agree to follow the contribution guidelines.
What this fixes
GetTextureFormatinVulkanVideoPresenter.csdecodes a guest data-format + number-type pair into a Vulkan format. Formats 13 and 14 are the same 128-bit float layout and are handled together everywhere else this pair shows up:TryDecodeRenderTargetFormatin the same file:(13, 7) or (14, 7),(13, 0) or (14, 0).MetalGuestFormats.DecodeTextureFormat, which the comment on that method says mirrors this exact function "case for case"):(13, _) or (14, _) => Rgba32Float.In
GetTextureFormatitself, format 13 has a real wildcard ((13, _) => R32G32B32A32Sfloat), but format 14 was only matched at number type 7:Any format-14 texture using a number type other than 4/5/7 falls through the whole switch to the unrelated final default (
R8G8B8A8Unorm) instead of the 128-bit float format — wrong bytes-per-pixel and wrong interpretation for whatever texture hit that path. Given the other two tables agree 13 and 14 should behave identically, this reads like the14, _case was typed as14, 7when the block was duplicated from format 13's.Fix is a one-line change, widening the same way format 13 already is:
Testing
GetTextureFormatlives on aprivate sealed classnested insideVulkanVideoPresenter, so it isn't reachable from the test project as-is (nothing currently covers it, including its existing cases) — didn't want to widen internal visibility just to test one line. Built the solution (dotnet build SharpEmu.slnx -c Release) clean and ran the existingVulkanPresentEncodeFormatTestssuite, both pass. I don't have a title on hand that hits guest format 14 with an unusual number type, so I can't attach a before/after game log — the case is derived from the two parallel tables agreeing with each other, not from a repro.Checklist
By submitting this pull request, you confirm that:
CONTRIBUTING.md.N/A.N/A).