mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix AMD CI SDK layout check and tighten DX12 interop preflight
This commit is contained in:
parent
19bc52f54e
commit
8b1fc42b7a
2 changed files with 50 additions and 3 deletions
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
|
|
@ -86,12 +86,23 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
SDK_DIR="$PWD/extern/FidelityFX-SDK/sdk"
|
||||
test -f "$SDK_DIR/include/FidelityFX/host/ffx_frameinterpolation.h"
|
||||
if [ -f "$SDK_DIR/include/FidelityFX/gpu/frameinterpolation/ffx_frameinterpolation_callbacks_glsl.h" ] \
|
||||
KITS_DIR="$PWD/extern/FidelityFX-SDK/Kits/FidelityFX"
|
||||
LEGACY_OK=0
|
||||
KITS_OK=0
|
||||
if [ -f "$SDK_DIR/include/FidelityFX/host/ffx_frameinterpolation.h" ]; then
|
||||
LEGACY_OK=1
|
||||
fi
|
||||
if [ -f "$KITS_DIR/framegeneration/include/ffx_framegeneration.h" ]; then
|
||||
KITS_OK=1
|
||||
fi
|
||||
|
||||
if [ "$LEGACY_OK" -eq 1 ] && [ -f "$SDK_DIR/include/FidelityFX/gpu/frameinterpolation/ffx_frameinterpolation_callbacks_glsl.h" ] \
|
||||
&& [ -f "$SDK_DIR/include/FidelityFX/gpu/opticalflow/ffx_opticalflow_callbacks_glsl.h" ] \
|
||||
&& [ -f "$SDK_DIR/src/backends/vk/CMakeShadersFrameinterpolation.txt" ] \
|
||||
&& [ -f "$SDK_DIR/src/backends/vk/CMakeShadersOpticalflow.txt" ]; then
|
||||
echo "FidelityFX-SDK Vulkan framegen files detected."
|
||||
echo "FidelityFX-SDK legacy Vulkan framegen files detected."
|
||||
elif [ "$KITS_OK" -eq 1 ]; then
|
||||
echo "FidelityFX-SDK Kits layout detected (DX12-focused framegeneration APIs available)."
|
||||
else
|
||||
echo "FidelityFX-SDK Vulkan framegen files are missing in this checkout; build continues."
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -56,6 +56,39 @@ bool hasExtension(const std::vector<VkExtensionProperties>& extensions, const ch
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasExternalImageInteropSupport(VkPhysicalDevice physicalDevice, VkFormat format) {
|
||||
if (!physicalDevice || format == VK_FORMAT_UNDEFINED) return false;
|
||||
|
||||
VkPhysicalDeviceExternalImageFormatInfo externalInfo{};
|
||||
externalInfo.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO;
|
||||
externalInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
|
||||
|
||||
VkPhysicalDeviceImageFormatInfo2 imageInfo{};
|
||||
imageInfo.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2;
|
||||
imageInfo.format = format;
|
||||
imageInfo.type = VK_IMAGE_TYPE_2D;
|
||||
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||
imageInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT |
|
||||
VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||
imageInfo.flags = 0;
|
||||
imageInfo.pNext = &externalInfo;
|
||||
|
||||
VkExternalImageFormatProperties externalProps{};
|
||||
externalProps.sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES;
|
||||
|
||||
VkImageFormatProperties2 imageProps{};
|
||||
imageProps.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
|
||||
imageProps.pNext = &externalProps;
|
||||
|
||||
const VkResult res = vkGetPhysicalDeviceImageFormatProperties2(physicalDevice, &imageInfo, &imageProps);
|
||||
if (res != VK_SUCCESS) return false;
|
||||
|
||||
const VkExternalMemoryFeatureFlags features = externalProps.externalMemoryProperties.externalMemoryFeatures;
|
||||
const bool exportable = (features & VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT) != 0;
|
||||
const bool importable = (features & VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT) != 0;
|
||||
return exportable && importable;
|
||||
}
|
||||
#endif
|
||||
|
||||
enum class WrapperBackend {
|
||||
|
|
@ -316,6 +349,9 @@ bool runDx12BridgePreflight(const WoweeFsr3WrapperInitDesc* initDesc, std::strin
|
|||
missing.emplace_back(extName);
|
||||
}
|
||||
}
|
||||
if (!hasExternalImageInteropSupport(initDesc->physicalDevice, initDesc->colorFormat)) {
|
||||
missing.emplace_back("external memory export/import support for swap/upscale format");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue