Skip to content

build: OFFSCREEN_AGILITY_620_DIR builds fail on a 40-byte view-description static_assert #3165

Done

Description

@Not-Saii

Reproduction

Current main (88cddb09), Windows 11 build 26300, MSVC 14.44.35207, Windows SDK 10.0.26100, Agility SDK 1.620.2 from nuget.org (sdk.nupkg next to its x64 DLLs, as described in docs/experiments.md):

cmake --preset dev -B out/build/warp122 -DOFFSCREEN_AGILITY_620_DIR=<agility dir> -DOFFSCREEN_WARP_DIR=<warp dir>
cmake --build out/build/warp122 --target offscreen_check startup_stream_consumer

Expected and observed

Expected: both targets build, as they did when #147 was merged.

Observed: d3d12_xs_device.cpp fails in both d3d12_xs_shim and offscreen_check:

src\startup_stubs/d3d12_compute_dispatch.inl(353): error C2607: static assertion failed

That line is static_assert(sizeof(D3D12_SHADER_RESOURCE_VIEW_DESC) == 40 && sizeof(D3D12_UNORDERED_ACCESS_VIEW_DESC) == 40);, added in #2532. The option puts the Agility SDK 1.620 headers first on the include path of these two targets. With them, D3D12_UNORDERED_ACCESS_VIEW_DESC is 48 bytes, because the new D3D12_BUFFER_UAV_BYTE_OFFSET union member is larger than any member of the desktop SDK union. D3D12_SHADER_RESOURCE_VIEW_DESC stays 40 bytes (measured with sizeof against both header sets).

The default build (option unset) is unaffected. Every opt-in Agility build is affected, including the offscreen_check WARP checks from #147 (bvh_wave64_warp, dxr_query_warp and the others) and every test that runs startup_stream_consumer.

Notes

The view record copies the title's description bytes (record.desc_bytes >= sizeof(desc)), so making the buffer 48 bytes would also change, for UAVs, which descriptions count as "described". A fix probably needs to separate the size of the title layout (40 bytes) from the size of the header struct. I have not written one.

AI-assisted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions