gpu: create 16-bit packed targets the adapter cannot use as R8G8B8A8 #1285

Merged
JohnConnorNPC merged 8 commits from upstream-pr/1292 into main 2026-11-24 10:10:13 +00:00
JohnConnorNPC commented 2026-11-24 06:59:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-24T06:59:56Z.


Refs #870, #874.

Problem

A console executable creates B5G5R5A1_UNORM and B4G4R4A4_UNORM textures as render targets and for unordered access. The startup device wrapper passes those descriptions to desktop unchanged. On an adapter without that use for the packed format the description is refused:

  • GetResourceAllocationInfo answers all ones (the wrapper logs invalid desc[0]=...);
  • the texture is never created.

null_texture_view.h already handles the same two formats, but only for views with no resource.

Change

src/startup_stubs/packed_target_format.h:

  • packed_target_stand_in returns R8G8B8A8_UNORM for a B5G5R5A1/B4G4R4A4 texture description that asks for render-target or unordered-access use the adapter lacks, provided R8G8B8A8_UNORM has that use. Otherwise it returns the format unchanged.
  • packed_view_format makes a view that names a packed format on such a texture use R8G8B8A8_UNORM.

sanitized() applies the first after the console-format mapping, with CheckFeatureSupport as the support query; the view slots apply the second. The first four stand-ins are logged as a shortcut.

Not converted: texel data the executable writes itself in the packed layout. The two textures seen here are 2560 x 1440 targets that are only drawn to.

Evidence

Commit under test: the head of this branch, on main at 93cb6a2a.

Device-free check (tests/startup_packed_target_check.cpp, registered as startup_packed_target), which drives the selection with adapters described by their D3D12_FORMAT_SUPPORT1 bits:

startup_packed_target: PASS (5 stand-ins, 8 unchanged, 5 view formats)

The controls inside it: an adapter that supports both packed formats changes nothing; an adapter with render-target but no typed-UAV support changes RT|UAV and leaves RT alone; no stand-in is chosen when R8G8B8A8_UNORM lacks the use too, when no RT/UAV use is asked, for B5G6R5 and for buffers; a packed view of a texture that is not a stand-in keeps its format.

Whole-program run. One console executable under the startup debugger, offline; Linux host, Wine with vkd3d-proton, NVIDIA RTX 4070 Ti SUPER. Measured with a local build that has the same selection inline (not this branch's header):

  • Before: two descriptions were refused, B5G5R5A1 with flags RT|UAV and B4G4R4A4 with flags RT, both 2560 x 1440. vkd3d-proton reported "Requested resource flags ..., but no format in cast list supports it" for each, and the wrapper logged two invalid desc lines.
  • After: both are created as R8G8B8A8_UNORM, no invalid desc line is logged, and the run continues.

This change alone did not move where that run stopped; the stop was the allocation sizes in #1290.

Also ran python -B tests/docs_links_check.py (pass) and git diff --check (clean).

Not measured

  • Windows. I have no Windows host. The check was compiled with clang-cl against the Windows SDK and run under Wine, and d3d12_xs_device.cpp was syntax-checked the same way; CI is the first MSVC build.
  • Which native drivers lack these uses. The refusal is measured through vkd3d-proton only. On an adapter that supports the packed formats this change does nothing.
  • This branch's header has not been through a whole-program run; the inline equivalent has.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6576455780 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1292). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-24T06:59:56Z. --- Refs #870, #874. ## Problem A console executable creates B5G5R5A1_UNORM and B4G4R4A4_UNORM textures as render targets and for unordered access. The startup device wrapper passes those descriptions to desktop unchanged. On an adapter without that use for the packed format the description is refused: - `GetResourceAllocationInfo` answers all ones (the wrapper logs `invalid desc[0]=...`); - the texture is never created. `null_texture_view.h` already handles the same two formats, but only for views with no resource. ## Change `src/startup_stubs/packed_target_format.h`: - `packed_target_stand_in` returns R8G8B8A8_UNORM for a B5G5R5A1/B4G4R4A4 texture description that asks for render-target or unordered-access use the adapter lacks, provided R8G8B8A8_UNORM has that use. Otherwise it returns the format unchanged. - `packed_view_format` makes a view that names a packed format on such a texture use R8G8B8A8_UNORM. `sanitized()` applies the first after the console-format mapping, with `CheckFeatureSupport` as the support query; the view slots apply the second. The first four stand-ins are logged as a shortcut. Not converted: texel data the executable writes itself in the packed layout. The two textures seen here are 2560 x 1440 targets that are only drawn to. ## Evidence Commit under test: the head of this branch, on `main` at `93cb6a2a`. **Device-free check** (`tests/startup_packed_target_check.cpp`, registered as `startup_packed_target`), which drives the selection with adapters described by their `D3D12_FORMAT_SUPPORT1` bits: ``` startup_packed_target: PASS (5 stand-ins, 8 unchanged, 5 view formats) ``` The controls inside it: an adapter that supports both packed formats changes nothing; an adapter with render-target but no typed-UAV support changes RT|UAV and leaves RT alone; no stand-in is chosen when R8G8B8A8_UNORM lacks the use too, when no RT/UAV use is asked, for B5G6R5 and for buffers; a packed view of a texture that is not a stand-in keeps its format. **Whole-program run.** One console executable under the startup debugger, offline; Linux host, Wine with vkd3d-proton, NVIDIA RTX 4070 Ti SUPER. Measured with a local build that has the same selection inline (not this branch's header): - Before: two descriptions were refused, B5G5R5A1 with flags RT|UAV and B4G4R4A4 with flags RT, both 2560 x 1440. vkd3d-proton reported "Requested resource flags ..., but no format in cast list supports it" for each, and the wrapper logged two `invalid desc` lines. - After: both are created as R8G8B8A8_UNORM, no `invalid desc` line is logged, and the run continues. This change alone did not move where that run stopped; the stop was the allocation sizes in #1290. Also ran `python -B tests/docs_links_check.py` (pass) and `git diff --check` (clean). ## Not measured - **Windows.** I have no Windows host. The check was compiled with clang-cl against the Windows SDK and run under Wine, and `d3d12_xs_device.cpp` was syntax-checked the same way; CI is the first MSVC build. - **Which native drivers lack these uses.** The refusal is measured through vkd3d-proton only. On an adapter that supports the packed formats this change does nothing. - This branch's header has not been through a whole-program run; the inline equivalent has.
tedin7 commented 2026-11-24 07:07:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:03:54Z.

Review: COMMENTED


Dual-platform review at commit 64985368cf97b7ba0ef8aca8e9d7f77869679959:

Linux checks

  • git diff --check origin/main...HEAD: passed
  • python -B tests/docs_links_check.py: passed (16 Markdown files, 286 links)
  • python -B tests/bidi_controls_check.py: passed (1081 tracked files)

Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)

  • Debug (--preset dev):
    • cmake --build --preset dev --target startup_packed_target_check -- -j 6: 3.72s
    • ctest --preset dev -R '^startup_packed_target$' --parallel 4 --no-tests=error --output-on-failure: 1/1 passed
  • Release /O2 (--preset release):
    • cmake --build --preset release --target startup_packed_target_check -- -j 6: 1.13s
    • ctest --preset release -R '^startup_packed_target$' --parallel 4 --no-tests=error --output-on-failure: 1/1 passed

Notes & Edge Cases

  • src/startup_stubs/packed_target_format.h cleanly restricts the R8G8B8A8_UNORM stand-in to B5G5R5A1_UNORM and B4G4R4A4_UNORM textures requesting ALLOW_RENDER_TARGET or ALLOW_UNORDERED_ACCESS when the adapter lacks those support bits while R8G8B8A8_UNORM has them, leaving buffers, sampled-only textures, and supported adapters untouched.
  • In src/startup_stubs/d3d12_xs_device.cpp, both sanitized() (used for allocation info and resource creation) and view_slot() (slots 18–21) are wired consistently, and DXGI_FORMAT_UNKNOWN view descriptors continue to inherit the stand-in resource's R8G8B8A8_UNORM format.
  • Scope note: startup_packed_target_check tests packed_target_format.h standalone against mock support-bit adapters; d3d12_xs_device.cpp itself was reviewed by inspection and not compiled in this targeted run.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6035008641 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1292#pullrequestreview-6035008641). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T07:03:54Z. **Review:** COMMENTED --- Dual-platform review at commit `64985368cf97b7ba0ef8aca8e9d7f77869679959`: ### Linux checks - `git diff --check origin/main...HEAD`: passed - `python -B tests/docs_links_check.py`: passed (16 Markdown files, 286 links) - `python -B tests/bidi_controls_check.py`: passed (1081 tracked files) ### Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) - **Debug (`--preset dev`)**: - `cmake --build --preset dev --target startup_packed_target_check -- -j 6`: `3.72s` - `ctest --preset dev -R '^startup_packed_target$' --parallel 4 --no-tests=error --output-on-failure`: **1/1 passed** - **Release `/O2` (`--preset release`)**: - `cmake --build --preset release --target startup_packed_target_check -- -j 6`: `1.13s` - `ctest --preset release -R '^startup_packed_target$' --parallel 4 --no-tests=error --output-on-failure`: **1/1 passed** ### Notes & Edge Cases - `src/startup_stubs/packed_target_format.h` cleanly restricts the `R8G8B8A8_UNORM` stand-in to `B5G5R5A1_UNORM` and `B4G4R4A4_UNORM` textures requesting `ALLOW_RENDER_TARGET` or `ALLOW_UNORDERED_ACCESS` when the adapter lacks those support bits while `R8G8B8A8_UNORM` has them, leaving buffers, sampled-only textures, and supported adapters untouched. - In `src/startup_stubs/d3d12_xs_device.cpp`, both `sanitized()` (used for allocation info and resource creation) and `view_slot()` (slots 18–21) are wired consistently, and `DXGI_FORMAT_UNKNOWN` view descriptors continue to inherit the stand-in resource's `R8G8B8A8_UNORM` format. - **Scope note**: `startup_packed_target_check` tests `packed_target_format.h` standalone against mock support-bit adapters; `d3d12_xs_device.cpp` itself was reviewed by inspection and not compiled in this targeted run.
R0Y00 commented 2026-11-24 10:02:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T09:26:16Z.

Review: CHANGES_REQUESTED


The view fallback currently decides from the requested and desktop formats alone. That also rewrites a packed view requested on an ordinary RGBA8 resource, even though the resource was never substituted. Please carry explicit substitution provenance on the resource, refuse mismatched packed views, and narrow the first path to the demonstrated 2D target roles. The device-free matrix alone cannot show view/creation behavior. Please add a source-built Windows resource, view and draw/readback comparison, including a plain RGBA8 resource and a supported packed format as controls. Describe quantization and CPU-authored texture limits explicitly.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6036662031 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1292#pullrequestreview-6036662031). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T09:26:16Z. **Review:** CHANGES_REQUESTED --- The view fallback currently decides from the requested and desktop formats alone. That also rewrites a packed view requested on an ordinary RGBA8 resource, even though the resource was never substituted. Please carry explicit substitution provenance on the resource, refuse mismatched packed views, and narrow the first path to the demonstrated 2D target roles. The device-free matrix alone cannot show view/creation behavior. Please add a source-built Windows resource, view and draw/readback comparison, including a plain RGBA8 resource and a supported packed format as controls. Describe quantization and CPU-authored texture limits explicitly.
JohnConnorNPC commented 2026-11-24 10:02:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-24T09:47:26Z.


All five points are addressed in 9845a1a8. The fixture you asked for also found a bug in the PR, described under "Draw path".

Provenance. A stand-in texture now carries the format it was asked for as private data on the desktop resource (mark_packed_stand_in / packed_stand_in_of), set at each place a texture is created from a sanitized description. The view decision no longer looks at formats alone.

Views. packed_view(view format, resource format, stands in for) gives one of three verdicts:

View Texture Verdict
packed P stand-in for P created as R8G8B8A8_UNORM
packed P a texture of format P unchanged
packed P plain R8G8B8A8_UNORM, the stand-in for the other packed format, or any other format refused: the view is skipped and logged
not packed any unchanged

Draw path. The translated draw path builds its own shader-resource view from the recorded description, and it still named the packed format on a stand-in texture. The first run of the new fixture read garbage instead of the clear colour because of it. That path now applies the same verdict, and binds a null texture for a refused view.

Narrowed rule. Only what was measured: a single-sample 2D texture with one array slice that is a render target, alone or with unordered access. 1D and 3D textures, arrays, multisampled textures, and unordered access without the render-target flag keep their format (new unit cases for each).

Windows fixture. tests/startup_packed_target_draw_check.py (startup_packed_target_draw_warp / _hardware) goes through the wrapper for each case: slot 133 creates a 64x64 texture, a render-target view clears it to (0.45, 0.2, 0.8, 1), a shader-resource view samples it in a full-target draw, and every pixel of that draw is read back. The consumer reports the adapter's support bits and the format the helper selects, so the expected pixel follows the path the adapter takes:

Texture actually created Expected pixel
R8G8B8A8_UNORM stand-in (115, 51, 204, 255)
B5G5R5A1_UNORM (115, 49, 206, 255)
B4G4R4A4_UNORM (119, 51, 204, 255)
B5G6R5_UNORM (control) (115, 53, 206, 255)

Controls: B5G6R5_UNORM (a packed format outside the rule) and R8G8B8A8_UNORM are drawn and must never be substituted or logged as stand-ins. B5G5R5A1 views of a plain R8G8B8A8_UNORM texture, and of a B4G4R4A4 target, must both be refused (render-target view and shader-resource view), the draw must bind null, and the clear colour must not appear.

Limits, now stated in the header and docs/startup-runtime.md: the stand-in keeps 8 bits where the packed formats keep 5, 4 or 1, so rendered values are not quantized (0.45 reads 115 here, 119 from B4G4R4A4); texel data the executable writes or reads itself in the 16-bit layout is not converted; unordered-access writes to a stand-in have no fixture.

Results here (clang-cl build under Wine 11.0 with vkd3d-proton, RTX 4070 Ti SUPER; translation-layer, hardware only):

startup_packed_target: PASS (3 stand-ins, 13 unchanged, 9 view verdicts)
hardware B5G5R5A1 render target with unordered access: texture format 28 (stand-in), read (115, 51, 204, 255)
hardware B4G4R4A4 render target: texture format 28 (stand-in), read (115, 51, 204, 255)
hardware control, B5G6R5 render target: texture format 85 (as described), read (115, 52, 206, 255)
hardware control, R8G8B8A8 render target: texture format 28 (as described), read (115, 51, 204, 255)
hardware B5G5R5A1 views of a plain R8G8B8A8 texture: both views refused (packed format 86 on a texture of format 28 that does not stand in for it)
hardware B5G5R5A1 views of a B4G4R4A4 render target: both views refused (packed format 86 on a texture of format 28 that does not stand in for it)
startup_packed_target_draw: PASS on hardware (packed targets drawn stand-in on this adapter; 2 drawn controls, 2 refused view pairs; unordered-access writes and CPU-written texels not covered)

The existing startup_xg_bc7_draw and startup_stream_draw checks still pass on the same build.

Not verified: Windows and WARP. On an adapter that supports the packed formats as render targets the fixture takes the "as described" branch and expects the quantized pixels above; that branch has not run anywhere yet, so CI on WARP will be its first run, and the 5- and 4-bit expectations there are computed, not measured. Here the shaders were compiled with fxc in place of DXC.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7127891620 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1292#issuecomment-7127891620). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-24T09:47:26Z. --- All five points are addressed in `9845a1a8`. The fixture you asked for also found a bug in the PR, described under "Draw path". **Provenance.** A stand-in texture now carries the format it was asked for as private data on the desktop resource (`mark_packed_stand_in` / `packed_stand_in_of`), set at each place a texture is created from a sanitized description. The view decision no longer looks at formats alone. **Views.** `packed_view(view format, resource format, stands in for)` gives one of three verdicts: | View | Texture | Verdict | |---|---|---| | packed P | stand-in for P | created as R8G8B8A8_UNORM | | packed P | a texture of format P | unchanged | | packed P | plain R8G8B8A8_UNORM, the stand-in for the other packed format, or any other format | refused: the view is skipped and logged | | not packed | any | unchanged | **Draw path.** The translated draw path builds its own shader-resource view from the recorded description, and it still named the packed format on a stand-in texture. The first run of the new fixture read garbage instead of the clear colour because of it. That path now applies the same verdict, and binds a null texture for a refused view. **Narrowed rule.** Only what was measured: a single-sample 2D texture with one array slice that is a render target, alone or with unordered access. 1D and 3D textures, arrays, multisampled textures, and unordered access without the render-target flag keep their format (new unit cases for each). **Windows fixture.** `tests/startup_packed_target_draw_check.py` (`startup_packed_target_draw_warp` / `_hardware`) goes through the wrapper for each case: slot 133 creates a 64x64 texture, a render-target view clears it to (0.45, 0.2, 0.8, 1), a shader-resource view samples it in a full-target draw, and every pixel of that draw is read back. The consumer reports the adapter's support bits and the format the helper selects, so the expected pixel follows the path the adapter takes: | Texture actually created | Expected pixel | |---|---| | R8G8B8A8_UNORM stand-in | (115, 51, 204, 255) | | B5G5R5A1_UNORM | (115, 49, 206, 255) | | B4G4R4A4_UNORM | (119, 51, 204, 255) | | B5G6R5_UNORM (control) | (115, 53, 206, 255) | Controls: B5G6R5_UNORM (a packed format outside the rule) and R8G8B8A8_UNORM are drawn and must never be substituted or logged as stand-ins. B5G5R5A1 views of a plain R8G8B8A8_UNORM texture, and of a B4G4R4A4 target, must both be refused (render-target view and shader-resource view), the draw must bind null, and the clear colour must not appear. **Limits, now stated** in the header and `docs/startup-runtime.md`: the stand-in keeps 8 bits where the packed formats keep 5, 4 or 1, so rendered values are not quantized (0.45 reads 115 here, 119 from B4G4R4A4); texel data the executable writes or reads itself in the 16-bit layout is not converted; unordered-access writes to a stand-in have no fixture. **Results here** (clang-cl build under Wine 11.0 with vkd3d-proton, RTX 4070 Ti SUPER; translation-layer, `hardware` only): ``` startup_packed_target: PASS (3 stand-ins, 13 unchanged, 9 view verdicts) hardware B5G5R5A1 render target with unordered access: texture format 28 (stand-in), read (115, 51, 204, 255) hardware B4G4R4A4 render target: texture format 28 (stand-in), read (115, 51, 204, 255) hardware control, B5G6R5 render target: texture format 85 (as described), read (115, 52, 206, 255) hardware control, R8G8B8A8 render target: texture format 28 (as described), read (115, 51, 204, 255) hardware B5G5R5A1 views of a plain R8G8B8A8 texture: both views refused (packed format 86 on a texture of format 28 that does not stand in for it) hardware B5G5R5A1 views of a B4G4R4A4 render target: both views refused (packed format 86 on a texture of format 28 that does not stand in for it) startup_packed_target_draw: PASS on hardware (packed targets drawn stand-in on this adapter; 2 drawn controls, 2 refused view pairs; unordered-access writes and CPU-written texels not covered) ``` The existing `startup_xg_bc7_draw` and `startup_stream_draw` checks still pass on the same build. **Not verified:** Windows and WARP. On an adapter that supports the packed formats as render targets the fixture takes the "as described" branch and expects the quantized pixels above; that branch has not run anywhere yet, so CI on WARP will be its first run, and the 5- and 4-bit expectations there are computed, not measured. Here the shaders were compiled with fxc in place of DXC.
upstream-sync closed this pull request 2026-11-24 11:02:34 +00:00
tedin7 commented 2026-11-24 11:02:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T10:05:47Z.

Review: COMMENTED


Technical peer-review (retest) of commit 9845a1a80069fece03bae20c5c2a71b1867dce87:

Verification

  • Linux:
    • git diff --check origin/main...HEAD: clean.
    • tests/docs_links_check.py: passed (16 Markdown files, 308 links).
    • tests/bidi_controls_check.py: passed (1,156 files).
    • python -B -m py_compile tests/startup_packed_target_draw_check.py: passed.
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): targets built (24.35s, configure 1.66s); ctest -R '^(startup_packed_target|startup_packed_target_draw_warp|startup_stream_draw_warp|startup_stubs)$' 4/4 passed (1.67s: startup_packed_target 0.01s, startup_stubs 0.53s, startup_packed_target_draw_warp 0.74s, startup_stream_draw_warp 1.59s).
    • Release /O2 (--preset release): targets built (35.85s, configure 1.60s); ctest 4/4 passed (1.77s: startup_packed_target 0.02s, startup_stubs 0.38s, startup_packed_target_draw_warp 0.69s, startup_stream_draw_warp 1.71s).

Findings

  • The previous review feedback is addressed:
    • Explicit substitution provenance is stored via SetPrivateData(packed_stand_in_tag, ...) across create_slot, device_place_resource_x, device_create_committed_x, and sampled_address_texture.
    • packed_target_stand_in is narrowed to single-sample 2D ALLOW_RENDER_TARGET (with optional ALLOW_UNORDERED_ACCESS, excluding ALLOW_DEPTH_STENCIL).
    • packed_view refuses mismatched packed views (including packed views on plain R8G8B8A8_UNORM or on the other packed format's stand-in) in both view_slot and draw_translated.
    • Both startup_packed_target (device-free matrix: 3 stand-ins, 13 unchanged, 9 view verdicts) and startup_packed_target_draw_warp (source-built D3D12 resource/view/draw/readback with B5G6R5_UNORM and R8G8B8A8_UNORM controls plus refused-view pairs) pass, and docs/startup-runtime.md documents quantization and CPU-authored texel limits.
  • Minor note (src/startup_stubs/d3d12_xs_device.cpp, view_slot): view_slot<17, 1> (CreateConstantBufferView) and view_slot<22, 1> (CreateSampler) have desc_index == 1, where args[0] is the descriptor pointer rather than an ID3D12Resource* and desc_copy starts with BufferLocation / Filter rather than DXGI_FORMAT. Guarding the packed-view check with desc_index >= 2 (slots 18–21) would prevent args[0] from ever being cast to ID3D12Resource* if the low 32 bits of a BufferLocation ever equalled 86 or 115.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6037228439 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1292#pullrequestreview-6037228439). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T10:05:47Z. **Review:** COMMENTED --- Technical peer-review (retest) of commit `9845a1a80069fece03bae20c5c2a71b1867dce87`: ### Verification - **Linux**: - `git diff --check origin/main...HEAD`: clean. - `tests/docs_links_check.py`: passed (16 Markdown files, 308 links). - `tests/bidi_controls_check.py`: passed (1,156 files). - `python -B -m py_compile tests/startup_packed_target_draw_check.py`: passed. - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: targets built (`24.35s`, configure `1.66s`); `ctest -R '^(startup_packed_target|startup_packed_target_draw_warp|startup_stream_draw_warp|startup_stubs)$'` **4/4 passed** (`1.67s`: `startup_packed_target` `0.01s`, `startup_stubs` `0.53s`, `startup_packed_target_draw_warp` `0.74s`, `startup_stream_draw_warp` `1.59s`). - **Release `/O2` (`--preset release`)**: targets built (`35.85s`, configure `1.60s`); `ctest` **4/4 passed** (`1.77s`: `startup_packed_target` `0.02s`, `startup_stubs` `0.38s`, `startup_packed_target_draw_warp` `0.69s`, `startup_stream_draw_warp` `1.71s`). ### Findings - The previous review feedback is addressed: - Explicit substitution provenance is stored via `SetPrivateData(packed_stand_in_tag, ...)` across `create_slot`, `device_place_resource_x`, `device_create_committed_x`, and `sampled_address_texture`. - `packed_target_stand_in` is narrowed to single-sample 2D `ALLOW_RENDER_TARGET` (with optional `ALLOW_UNORDERED_ACCESS`, excluding `ALLOW_DEPTH_STENCIL`). - `packed_view` refuses mismatched packed views (including packed views on plain `R8G8B8A8_UNORM` or on the other packed format's stand-in) in both `view_slot` and `draw_translated`. - Both `startup_packed_target` (device-free matrix: 3 stand-ins, 13 unchanged, 9 view verdicts) and `startup_packed_target_draw_warp` (source-built D3D12 resource/view/draw/readback with `B5G6R5_UNORM` and `R8G8B8A8_UNORM` controls plus refused-view pairs) pass, and `docs/startup-runtime.md` documents quantization and CPU-authored texel limits. - **Minor note (`src/startup_stubs/d3d12_xs_device.cpp`, `view_slot`)**: `view_slot<17, 1>` (`CreateConstantBufferView`) and `view_slot<22, 1>` (`CreateSampler`) have `desc_index == 1`, where `args[0]` is the descriptor pointer rather than an `ID3D12Resource*` and `desc_copy` starts with `BufferLocation` / `Filter` rather than `DXGI_FORMAT`. Guarding the packed-view check with `desc_index >= 2` (slots 18–21) would prevent `args[0]` from ever being cast to `ID3D12Resource*` if the low 32 bits of a `BufferLocation` ever equalled `86` or `115`.
R0Y00 commented 2026-11-24 11:02:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T10:10:09Z.

Review: APPROVED


Reviewed the resource provenance tag, refused mismatched views and the exact endpoint for the B5G6R5 control. The Windows hardware and WARP draw results address the original review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6037290340 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1292#pullrequestreview-6037290340). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T10:10:09Z. **Review:** APPROVED --- Reviewed the resource provenance tag, refused mismatched views and the exact endpoint for the B5G6R5 control. The Windows hardware and WARP draw results address the original review.
R0Y00 commented 2026-11-24 11:02:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T10:07:06Z.


On RTX 4060 Laptop (32.0.16.1656), both substituted targets and the previous draw tests passed, but the ordinary B5G6R5 control read green 48 where the fixture expected 53. WARP passed. I pushed 5e94fe47 so the six-bit green channel uses an exact endpoint, with red and blue still distinguishing the packed formats from RGBA8. The five Release cases now pass on WARP and RTX, including the two refused view pairs. GitHub checks are running on the new head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7128339041 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1292#issuecomment-7128339041). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T10:07:06Z. --- On RTX 4060 Laptop (32.0.16.1656), both substituted targets and the previous draw tests passed, but the ordinary B5G6R5 control read green 48 where the fixture expected 53. WARP passed. I pushed 5e94fe47 so the six-bit green channel uses an exact endpoint, with red and blue still distinguishing the packed formats from RGBA8. The five Release cases now pass on WARP and RTX, including the two refused view pairs. GitHub checks are running on the new head.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1285
No description provided.