Repository navigation
Conversation
…RGB9E5-UINT-ALIAS-VIEW)
The console title packs light as R9G9B9E5_SHAREDEXP bits into R32_UINT
textures from compute shaders, which cannot store that format, and
samples them through R9G9B9E5_SHAREDEXP shader-resource views of the
same texture: the sky, the sky and light probes, bounced light, cloud
and sky volumes. The console allows that view; desktop D3D12 refuses
it, and so did the layer ("incompatible R9G9B9E5 view format"), so
those reads would have come out empty.
On the title's device, the Vulkan device behind the Xbox-ABI proxy
(set_device_outer, which D3D12XboxCreateDevice calls), an R32_UINT or
R9G9B9E5 texture that allows unordered access and shader resources is
now a MUTABLE_FORMAT image with {R32_UINT, E5B9G9R9_UFLOAT_PACK32} in
its format list: both are in Vulkan's 32-bit compatibility class, so
one image takes both views and nothing is copied. Its SRVs may name the
other format of the pair; the view in it is SAMPLED_BIT only and its T#
(5_9_9_9_FLOAT or 32_UINT) names the texture's own address. An
R32_UINT-backed R9G9B9E5 UAV texture (no E5B9G9R9 storage, as on
NVIDIA) already had that list, so its R32_UINT SRV costs nothing.
The decision is made in texture_format, which committed and placed
creation and GetResourceAllocationInfo share, so a placement's size is
the size of the image made. It is per device rather than per call: the
title creates textures through slots 76, 127 and 133 and through PC
slots the proxy forwards unread, and all of them, with the allocation
queries, must agree. Only textures a shader can write and read get the
list (a mutable image may lose the driver's compression), and only if
the GPU reports the combination (probed once at device creation).
Unordered-access views, multisampled and reserved textures keep the PC
rule. A device without the proxy, as the PC tests and the WARP parity
comparisons use, keeps refusing the view.
create_texture chained the format list to itself when a castable list
met a texture TextureCreateInfo had already given one (an R32_UINT-
backed UAV texture); it is chained once now.
Found by comparing with fxceless/victory-fork, a fork of VIctory that
fixed the same black sky, probes and fog by pointing the sampled
texture at the written one. Credit to that fork and to VIctory; the
code here is written anew.
Tested on an RTX 4070 SUPER (driver 621.24, Windows 11): the new
d3d12_rgb9e5_alias_view test (slot-76, placed, volume and castable
R32_UINT textures; the reverse view; refusals for UAVs, plain textures
and a device without the proxy; a compute store through the R32_UINT
UAV sampled back through the R9G9B9E5 SRV, 16 of 16 texels exact, and
read back unchanged) passes plainly and under LEONIDA_VK_VALIDATION=1
with 0 validation errors, and fails at the R9G9B9E5 SRV with the
layer change reverted. Full ctest on 364ab4e: 318/319 against
main's 317/318, the one failure d3d12_depth_resolve on both; rebased
onto 1154976 (with the texture memory pool): 320/321, the same one
failure, and the new test again plain and under validation. The
tests/ consistency set passes (578 passed, 5 skipped). No retail run:
it needs game files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
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.
Claimed in the coordination issue as: D3D-RGB9E5-UINT-ALIAS-VIEW (#14 (comment))
What and why
The console title packs light as R9G9B9E5_SHAREDEXP bits into
R32_UINTtextures from compute shaders, whichcannot store that format, and samples them through
R9G9B9E5_SHAREDEXPshader-resource views of the same texture(sky, sky and light probes, bounced light, cloud and sky volumes). The console allows that view; desktop D3D12
refuses it, and so did the layer ("incompatible R9G9B9E5 view format"), so those reads came out empty.
set_device_outer, whichD3D12XboxCreateDevicecalls), anR32_UINTorR9G9B9E5_SHAREDEXPtexture withALLOW_UNORDERED_ACCESS, noDENY_SHADER_RESOURCEand one sample is aMUTABLE_FORMATimage listing{R32_UINT, E5B9G9R9_UFLOAT_PACK32}(both in Vulkan's 32-bit compatibility class), and its SRVs may name the other format. One image takes both views;
nothing is copied. The other-format view is
SAMPLED_BITonly; its T# (5_9_9_9_FLOAT/32_UINT) names thetexture's own address. An
R32_UINT-backed R9G9B9E5 UAV texture (NVIDIA) already had that list.is_console_caller, as slots 61/74): the decision is needed at creation, the titlecreates through slots 76/127/133 and PC slots the proxy forwards unread, and
GetResourceAllocationInfomust agreewith creation for placements. It lives in
texture_format, which all of those share. A device without the proxy(the PC tests, the WARP parity comparisons) keeps the refusal.
compression, so other
R32_UINTtextures stay plain. Each combination is probed once at device creation.UAVs in the other format, multisampled and reserved textures keep the PC rule.
create_texturechaining its format list to itself when a castable list met a texture thatTextureCreateInfohad already given one (anR32_UINT-backed UAV texture).Found by comparing with fxceless/victory-fork, a fork of VIctory, which fixed the same black sky, probes and fog by
pointing the sampled texture at the written one. Credit to that fork and to VIctory; the code here is written anew.
Overlaps: trivial adjacent-line conflicts with #592 (fields and a doc bullet), #1079 (a member) and #578
(
write_image_descriptor's signature); none added with #427/#772. Semantically, #1079's slot 70/71 lookup skips aplacement of another format unless it lists it as castable; to resolve an R9G9B9E5 view from raw words to the
R32_UINTtexture it also needs to acceptcandidate->alias_format()— a one-line follow-up for whichever landssecond. #592's fp16 render targets get no alias, so the two don't interact.
Tested
d3d12_rgb9e5_alias_view(GPU): R32_UINT UAV textures from slot 76, placed, 3D and with a castable listtake an R9G9B9E5 SRV (registered in set 0); the reverse SRV works; UAVs in the other format, a plain R32_UINT
texture and a device without the proxy stay null; a compute dispatch stores 16 packed words through the R32_UINT
UAV and a second samples them through the R9G9B9E5 SRV, 16/16 texels exact, and the words read back unchanged.
Passes plainly and with
LEONIDA_VK_VALIDATION=1(0 validation errors); fails at the R9G9B9E5 SRV with the layerchange reverted.
everywhere is
d3d12_depth_resolve;d3d12_close_parity,d3d12_vulkan_deviceandd3d12_r9g9b9e5_uav(PCrefusal) pass.
GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (rebased onto 1154976).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf