feat(d3d12_x): create Vulkan image descriptions from texture resource descriptions #49

Manually merged
github merged 1 commit from gh-pr/49/head into gh-pr/49/base 2026-11-26 19:15:57 +00:00
Owner

@⁠Dark3581 on GitHub · 2026-11-22 21:27 UTC · original
Dark3581:feat/texture-desc → main · +406 −8 · 8 files · 1 commits · merged 2026-11-22 21:31 UTC

What

Texture creation's description half, from public D3D12 semantics:

  • resources/TextureDesc.cpp: TranslateTextureDesc turns a texture D3D12_RESOURCE_DESC into a VkImageCreateInfo. 1D, 2D and 3D textures with their extent and array size, the mip chain (MipLevels 0 is a full chain), the sample count, and usage from the flags (transfer always, sampled unless DENY_SHADER_RESOURCE, colour attachment, depth-stencil attachment, storage). Square 2D arrays of six layers are cube compatible, and 3D render targets can take 2D array views.
  • TextureStorageFormat extends the format table to textures: typeless formats become a format of their class with MUTABLE_FORMAT and EXTENDED_USAGE (the views choose the real format), the typeless depth families (R32_TYPELESS, R24G8_TYPELESS, R32G8X24_TYPELESS, R16_TYPELESS) become depth formats when the texture allows depth-stencil, BC1 to BC7 in all their variants, and B8G8R8X8 stored as B8G8R8A8.
  • Refused with an error naming the cause: buffers, row-major and swizzled layouts, formats without a mapping, too many mips, unsupported sample counts and multisampled textures that are not 2D single-mip, depth formats without ALLOW_DEPTH_STENCIL and the reverse, depth textures that also allow render target or UAV, DENY_SHADER_RESOURCE without depth-stencil, block-compressed textures that are 1D or writable, zero or oversized extents and unknown flags.
  • The device enables textureCompressionBC when offered, and the description records it as a requirement.

Whether the console's own texture creation path (a device method beyond the desktop ones) passes this description is not known; the debt fragment says so.

Tested

Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer.

  • pso_probe textures-selftest: full mip chains, the typeless, depth and block format mappings, twelve descriptions translated, six checked field by field (usage, flags, mips, layers, samples, the BC requirement), and 15 refusals with their messages.
  • pso_probe textures-gpu --validate: the twelve descriptions (render target and UAV with a full chain, typeless render target, D32 and typeless depth, an unsampled D32S8 array, a BC7 cube, a typeless BC1 array, a typeless R32 UAV, 4x MSAA RGBA16F, a 3D UAV render target, a 1D array UAV, BGRX) create images with 0 validation errors. Both run in the pipeline_state test.
  • MinGW ctest: 66 of 66. The d3d12_x targets and probes also build with MSVC 2022. python tools/check_conventions.py and debt_fold.py --check: ok.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • python tools/check_conventions.py passes (no comments in code, one declaration per export, Conventional Commit subjects)
  • Unimplemented paths stop (AbxNotImplemented / AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragment
  • Known gaps added, changed or removed through docs/dev/debt/changes/<branch>.md
  • Generic behaviour, not specific to one title
  • No game files, keys, notes or logs added to the repository
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • Source of behaviour: public D3D12 resource description and DXGI format documentation, Vulkan 1.3 specification
  • AI-assisted: yes
**@⁠Dark3581** on GitHub · 2026-11-22 21:27 UTC · [original](https://github.com/Dark3581/AnyBox/pull/49) `Dark3581:feat/texture-desc` → `main` · +406 −8 · 8 files · 1 commits · merged 2026-11-22 21:31 UTC ### What Texture creation's description half, from public D3D12 semantics: - **`resources/TextureDesc.cpp`**: `TranslateTextureDesc` turns a texture `D3D12_RESOURCE_DESC` into a `VkImageCreateInfo`. 1D, 2D and 3D textures with their extent and array size, the mip chain (`MipLevels` 0 is a full chain), the sample count, and usage from the flags (transfer always, sampled unless `DENY_SHADER_RESOURCE`, colour attachment, depth-stencil attachment, storage). Square 2D arrays of six layers are cube compatible, and 3D render targets can take 2D array views. - `TextureStorageFormat` extends the format table to textures: typeless formats become a format of their class with `MUTABLE_FORMAT` and `EXTENDED_USAGE` (the views choose the real format), the typeless depth families (`R32_TYPELESS`, `R24G8_TYPELESS`, `R32G8X24_TYPELESS`, `R16_TYPELESS`) become depth formats when the texture allows depth-stencil, BC1 to BC7 in all their variants, and `B8G8R8X8` stored as `B8G8R8A8`. - Refused with an error naming the cause: buffers, row-major and swizzled layouts, formats without a mapping, too many mips, unsupported sample counts and multisampled textures that are not 2D single-mip, depth formats without `ALLOW_DEPTH_STENCIL` and the reverse, depth textures that also allow render target or UAV, `DENY_SHADER_RESOURCE` without depth-stencil, block-compressed textures that are 1D or writable, zero or oversized extents and unknown flags. - The device enables `textureCompressionBC` when offered, and the description records it as a requirement. Whether the console's own texture creation path (a device method beyond the desktop ones) passes this description is not known; the debt fragment says so. ### Tested Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer. - `pso_probe textures-selftest`: full mip chains, the typeless, depth and block format mappings, twelve descriptions translated, six checked field by field (usage, flags, mips, layers, samples, the BC requirement), and 15 refusals with their messages. - `pso_probe textures-gpu --validate`: the twelve descriptions (render target and UAV with a full chain, typeless render target, D32 and typeless depth, an unsampled D32S8 array, a BC7 cube, a typeless BC1 array, a typeless R32 UAV, 4x MSAA RGBA16F, a 3D UAV render target, a 1D array UAV, BGRX) create images with 0 validation errors. Both run in the `pipeline_state` test. - MinGW `ctest`: 66 of 66. The `d3d12_x` targets and probes also build with MSVC 2022. `python tools/check_conventions.py` and `debt_fold.py --check`: ok. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] `python tools/check_conventions.py` passes (no comments in code, one declaration per export, Conventional Commit subjects) - [x] Unimplemented paths stop (`AbxNotImplemented` / `AbxUnsupported`); silent stubs are listed under Silent stubs through a debt fragment - [x] Known gaps added, changed or removed through `docs/dev/debt/changes/<branch>.md` - [x] Generic behaviour, not specific to one title - [x] No game files, keys, notes or logs added to the repository - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] Source of behaviour: public D3D12 resource description and DXGI format documentation, Vulkan 1.3 specification - [x] AI-assisted: yes
TextureDesc turns a D3D12 texture description into a VkImageCreateInfo: dimension and extent, the mip chain (0 for a full one), samples, usage from the resource flags, typeless formats as mutable images of their class, typeless depth families as depth formats, BC formats, cube compatibility and 2D array views of 3D render targets. Invalid combinations and unsupported layouts and flags are refused. The device enables textureCompressionBC when offered; pso_probe gains a self test and a GPU test that creates twelve images under the validation layer.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:15:55 +00:00
github manually merged commit 9a9bbdec92 into gh-pr/49/base 2026-11-26 19:15:57 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.