Repository navigation
d3d12: support LEONIDA_HOST_IMAGE_COPY=0 to force staging texture copies (RT-HOST-IMAGE-COPY-ENV) - #1810
d3d12: support LEONIDA_HOST_IMAGE_COPY=0 to force staging texture copies (RT-HOST-IMAGE-COPY-ENV)#1810abnalstlll-byte wants to merge 1 commit into
Conversation
…ies (RT-HOST-IMAGE-COPY-ENV) Support setting LEONIDA_HOST_IMAGE_COPY=0 (or off) to bypass VK_EXT_host_image_copy when creating the Vulkan device, forcing all WriteToSubresource and ReadFromSubresource CPU texture transfers through the existing staging queue submit path. This provides an immediate diagnostic bypass for driver-side host image transfer write faults (e.g. WRITE_INVALID device loss during world-start streaming on NVIDIA GPUs) while underlying driver/subresource layout investigations continue. Add test coverage in d3d12_vulkan_device_test.cpp and document in docs/d3d12_vulkan.md. AI-assisted (Claude Code)
|
This doesn't build with clang-cl 20 against the xwin UCRT headers (
AI-assisted (Claude Code). |
|
This does not build with MSVC: For a local test I replaced the call with |
|
Build failure with MSVC:
AI-assisted (Claude) |
|
@abnalstlll-byte thanks for picking this up so fast, and sorry for the overlap: I opened #1851 an hour later without spotting this one. They overlap in AI-assisted (Claude Code, Claude Opus 5.5). |
|
See my note on #1851 (#1851 (comment)): with #1893 and host image copy on, crash A did not reproduce in 2 runs here. Host copy off may no longer be needed for that crash; a check on another card is needed before deciding. AI-assisted. |
Description
This PR implements the
LEONIDA_HOST_IMAGE_COPY=0(oroff) environment variable switch, enabling community testers and CI to disableVK_EXT_host_image_copyand route all CPU texture transfers through the existing staging submit path.Context & Finding
VK_EXT_host_image_copyis the direct trigger for the fatalWRITE_INVALIDdevice loss during the transition to the first world frame (crashing at ~6,570 commands).Changes
runtime/shims/d3d12_vulkan_device.cpp:LEONIDA_HOST_IMAGE_COPYviagetenv_s. If set to"0"or"off", setinfo.host_image_copy = falseand log[rt] d3d12: LEONIDA_HOST_IMAGE_COPY=0; CPU texture copies use a staging submit.host_copyfrom the Vulkan 1.3pNextchain, omitsVK_EXT_host_image_copyfromdevice_extensions, and skips entry point loading.runtime/test/vk_test_device.h:LEONIDA_HOST_IMAGE_COPY=0inTestDevicefor consistent test harness behavior.runtime/test/d3d12_vulkan_device_test.cpp:_putenv_s("LEONIDA_HOST_IMAGE_COPY", "0")disablesmade->host_image_copyon standalone device creation and successfully executes CPU texture copies through the staging path.docs/d3d12_vulkan.md:LEONIDA_HOST_IMAGE_COPY=0under subresource copy options.Verification
python -I scripts/check_no_game_data.py: Clean-room confirmed, 0 violations.python -I tests/test_text_write_line_endings.py: 3/3 tests passed.Claimed in #1608 (#1608 (comment)).
AI-assisted (Claude Code)