5 Commits

Author SHA1 Message Date
0da4ca4028 rendering(r5a): allow R16_UNORM UAV views on native D16_UNORM[_S8_UINT] depth-stencil textures
On GPUs with native VK_FORMAT_D16_UNORM_S8_UINT (e.g. AMD RADV), Resource::enable_depth_stencil_uav created the plane-0 storage shadow as non-mutable DXGI_FORMAT_R16_UINT, causing CreateUnorderedAccessView to reject DXGI_FORMAT_R16_UNORM (format 56) views such as MaterialDepth (dsv=118) with all-zero descriptors. Use DXGI_FORMAT_R16_TYPELESS for depth16 plane-0 storage shadows across native and widened paths, allow R16_UINT and R16_UNORM views while rejecting typeless texture UAVs, and extend xbox_depth_storage_test.
2026-11-29 06:34:52 -05:00
05699d303c d3d12: restrict D24S8 castable widening to format 118 and mark the placed path
Follow-up review fixes for D24S8-made Xbox D16S8 (format 118) depth UAVs:
- Pass the console origin (recorded before pc_format()) into
  castable_view_formats() instead of widening on format.d24, so a plain PC
  D24_UNORM_S8_UINT texture keeps main's castable-format rules and refuses
  the R16/R8/118-120 depth-UAV views.
- Set mark_console_d16s8() in create_placed() as well as
  create_committed(). CreateReservedResource refuses format 118 before it
  makes anything (a stencil format has no tile shape), so it needs no mark.
- Extend xbox_d16s8_d24_storage to cover slot 127, incompatible castable
  views, plain PC D24S8 castable/UAV refusal, CreateCommittedResource2,
  CreatePlacedResource/2, and the CreateReservedResource refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:09:28 +02:00
9a375a064e d3d12: support depth-stencil UAVs for D24S8-made Xbox D16S8 (format 118)
On GPUs with native VK_FORMAT_D24_UNORM_S8_UINT attachments (NVIDIA),
pc_format() maps Xbox format 118 (D16_UNORM_S8_UINT) to
DXGI_FORMAT_D24_UNORM_S8_UINT before Resource construction. Previously,
Resource::enable_depth_stencil_uav only accepted R16_TYPELESS, 118, and
R32G8X24_TYPELESS, returning E_INVALIDARG so slots 76 and 133 fell back
to creating the texture without unordered access (#1558).

Track console format 118 origin on Resource before pc_format(), extend
enable_depth_stencil_uav and CreateUnorderedAccessView to serve D24S8-made
118 through the existing widened R16_TYPELESS (R16_UINT/R16_UNORM views)
plus R8_UINT storage planes and R32_FLOAT conversion image, and convert
plane-0 D24 depth words in transfer scratch to/from R32_SFLOAT via the
existing Depth24Converter compute pass in copy_depth_uav. Add
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT to copy scratch, accept D16S8/D24S8
castable lists in castable_view_formats, and keep #1558's refusal fallback
in d3d12_xs_device.cpp for any other provider refusal.

Replace xbox_d16s8_refused_uav with xbox_d16s8_d24_storage covering slot 76
6-layer round-trips, slot 133 1280x720 placement, CreateCommittedResource3
castable formats, R16_UNORM/R16_UINT/R8_UINT UAV clears, and direct D24S8
parent attachment readback.

Verified on Windows 10 19045 / GeForce GTX 1050 Ti (NVIDIA 582.66):
17/17 related CTests pass plain and with LEONIDA_VK_VALIDATION=1 (0
validation errors).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:08:38 +02:00
3cf0a41bc5 d3d12_xs: make a D16S8 depth texture without UAV when the depth provider refuses it
Since #939, slots 76 and 133 hand a depth-stencil texture with unordered access
to the depth provider. On a GPU with D24S8 attachments (every NVIDIA card) the
Vulkan layer's pc_format() makes D16_UNORM_S8_UINT (format 118) as
D24_UNORM_S8_UINT, and Resource::enable_depth_stencil_uav accepts only
R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it answers E_INVALIDARG. Slot 133
passed that on for a 1280x720 format 118 texture with ALLOW_DEPTH_STENCIL |
ALLOW_UNORDERED_ACCESS (all-ones layout), and the boot stopped on an int3.

When the provider refuses (E_INVALIDARG or E_NOTIMPL from the provider call
itself), slot 76 now makes the committed texture without unordered access and
slot 133 goes on to its stand-in (the title-placed texture, else the committed
one), as both did before the provider. The first refusal per slot is logged.
Any other failure is passed on as before: the provider out of memory, the
backing's own CreateCommittedResource, a refused placement or description.
The refused backing is released and no placement range is registered.

On a real boot (Windows 11, RTX 4070 SUPER, driver 621.24), on 0bc810504 with
an earlier form of this change that fell back on any failure of the depth path
(the only one that occurred was the provider's): the fallback fires once
(slot 133, format 118, hr=0x80070057), no int3, 6,187 PresentX ok and 0
failed, 69/69 captures non-black, and the boot reaches the first-run pages.
Without it, 3 of 3 boots stopped on the int3 after 182-362 PresentX.

Tests:
- xs_proxy_mock: a mock provider refusing a format 118 texture (E_INVALIDARG,
  E_NOTIMPL) through slots 76 and 133 gets S_OK and the stand-in, with the
  refused backing released; E_OUTOFMEMORY from the provider, a failing backing
  and a refused placement are passed on with no stand-in.
- xbox_d16s8_refused_uav (Vulkan, LEONIDA_CONSOLE_D16S8=d24): slots 76 and 133
  return a depth-stencil texture without unordered access.
Both fail without the change (slot 76 and slot 133 each checked on its own).

Follow-up: teach enable_depth_stencil_uav the D24S8-made form of format 118,
so these textures keep their UAVs on NVIDIA too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 23:34:00 -05:00
db19bbd345 runtime: connect native pipelines and title resources to the offline first-run UI
Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic.

The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
2026-11-24 21:19:30 +08:00