Skip to content

Commit ac1f46d

Browse files
committed
starit: explicit pNext=nullptr + struct addr logging
1 parent 68f09ca commit ac1f46d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/dxvk/dxvk_memory.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,12 @@ namespace dxvk {
13431343
DxvkDeviceMemory result = { };
13441344
result.size = size;
13451345

1346+
// Force pNext to nullptr. Box64 may not properly marshal this field
1347+
// (its wrapper leaves pNext uninitialized on its local struct). We set
1348+
// it here redundantly as a compiler barrier to ensure the store survives.
1349+
// Without this, vkAllocateMemory can return VK_ERROR_OUT_OF_HOST_MEMORY
1350+
// on Turnip when pNext is a garbage pointer that matches a known extension sType.
1351+
memoryInfo.pNext = nullptr;
13461352
// Diagnostic: log the exact VkMemoryAllocateInfo struct before call.
13471353
// This verifies Box64 doesn't corrupt allocationSize or memoryTypeIndex.
13481354
Logger::debug(str::format(
@@ -1352,6 +1358,10 @@ namespace dxvk {
13521358
", allocationSize=", memoryInfo.allocationSize,
13531359
", memoryTypeIndex=", memoryInfo.memoryTypeIndex,
13541360
"}]"));
1361+
// Also log struct address for Box64 translation debugging
1362+
Logger::debug(str::format(
1363+
"DxvkMemoryAllocator: &memoryInfo=", (void*)&memoryInfo,
1364+
" sizeof=", sizeof(memoryInfo)));
13551365
VkResult vr = vk->vkAllocateMemory(vk->device(), &memoryInfo, nullptr, &result.memory);
13561366
if (vr) {
13571367
Logger::err(str::format(
@@ -1367,6 +1377,7 @@ namespace dxvk {
13671377
// This is a workaround for KGSL per-process allocation count limits
13681378
// and potential race conditions in the kernel module.
13691379
std::this_thread::sleep_for(std::chrono::milliseconds(10));
1380+
memoryInfo.pNext = nullptr;
13701381
Logger::debug(str::format(
13711382
"DxvkMemoryAllocator: vkAllocateMemory retry[VkMemoryAllocateInfo={",
13721383
"sType=", memoryInfo.sType,

0 commit comments

Comments
 (0)