mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Add adrenotools direct mapping support
This commit is contained in:
@ -204,6 +204,12 @@ namespace skyline::gpu {
|
||||
bcnSupport[4] = isFormatSupported(vk::Format::eBc5UnormBlock) && isFormatSupported(vk::Format::eBc5SnormBlock);
|
||||
bcnSupport[5] = isFormatSupported(vk::Format::eBc6HSfloatBlock) && isFormatSupported(vk::Format::eBc6HUfloatBlock);
|
||||
bcnSupport[6] = isFormatSupported(vk::Format::eBc7UnormBlock) && isFormatSupported(vk::Format::eBc7SrgbBlock);
|
||||
|
||||
auto memoryProps{physicalDevice.getMemoryProperties2()};
|
||||
constexpr auto ReqMemFlags{vk::MemoryPropertyFlagBits::eDeviceLocal | vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent | vk::MemoryPropertyFlagBits::eHostCached};
|
||||
for (u32 i{}; i < memoryProps.memoryProperties.memoryTypeCount; i++)
|
||||
if ((memoryProps.memoryProperties.memoryTypes[i].propertyFlags & ReqMemFlags) == ReqMemFlags)
|
||||
hostVisibleCoherentCachedMemoryType = i;
|
||||
}
|
||||
|
||||
std::string TraitManager::Summary() {
|
||||
@ -269,7 +275,7 @@ namespace skyline::gpu {
|
||||
);
|
||||
}
|
||||
|
||||
void TraitManager::ApplyDriverPatches(const vk::raii::Context &context) {
|
||||
void TraitManager::ApplyDriverPatches(const vk::raii::Context &context, adrenotools_gpu_mapping *mapping) {
|
||||
// Create an instance without validation layers in order to get pointers to the functions we need to patch from the driver
|
||||
vk::ApplicationInfo applicationInfo{
|
||||
.apiVersion = VK_API_VERSION_1_0,
|
||||
@ -294,5 +300,10 @@ namespace skyline::gpu {
|
||||
Logger::Info("BCeNabler skipped, blob BCN support is present");
|
||||
bcnSupport.set();
|
||||
}
|
||||
|
||||
if (adrenotools_validate_gpu_mapping(mapping)) {
|
||||
Logger::Info("Applied GPU memory import patch");
|
||||
supportsAdrenoDirectMemoryImport = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user