Fix crash with if image data is over 4mb and other VK changes

This commit is contained in:
Stossy11 2024-12-10 15:47:45 +11:00
parent 7025c32c4a
commit e02037d9c3
5 changed files with 18 additions and 10 deletions

View File

@ -11,7 +11,7 @@ import UIKit
@main
struct MeloNXApp: App {
@AppStorage("showeddrmcheck") var showed = false
@AppStorage("showeddrmcheck") var showed = true
init() {
DispatchQueue.main.async { [self] in
@ -21,7 +21,7 @@ struct MeloNXApp: App {
if bool {
print("Yippee")
} else {
exit(0)
// exit(0)
}
}
} else {

View File

@ -105,8 +105,8 @@ namespace Ryujinx.Graphics.Vulkan
SupportsConditionalRendering = supportsConditionalRendering;
SupportsExtendedDynamicState = (OperatingSystem.IsIOS() ? OperatingSystem.IsIOSVersionAtLeast(17) ? supportsExtendedDynamicState : false : supportsExtendedDynamicState);
SupportsMultiView = supportsMultiView;
SupportsNullDescriptors = (OperatingSystem.IsIOS() ? false : supportsNullDescriptors);
SupportsPushDescriptors = (OperatingSystem.IsIOS() ? false : supportsNullDescriptors);
SupportsNullDescriptors = supportsNullDescriptors;
SupportsPushDescriptors = supportsPushDescriptors;
SupportsPrimitiveTopologyListRestart = supportsPrimitiveTopologyListRestart;
SupportsPrimitiveTopologyPatchListRestart = supportsPrimitiveTopologyPatchListRestart;
SupportsTransformFeedback = supportsTransformFeedback;

View File

@ -301,6 +301,10 @@ namespace Ryujinx.Graphics.Vulkan
properties.Limits.FramebufferDepthSampleCounts &
properties.Limits.FramebufferStencilSampleCounts;
bool isDynamicStateSupported = OperatingSystem.IsIOS()
? OperatingSystem.IsIOSVersionAtLeast(17) && _physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName)
: _physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName);
Capabilities = new HardwareCapabilities(
_physicalDevice.IsDeviceExtensionPresent("VK_EXT_index_type_uint8"),
supportsCustomBorderColor,
@ -316,7 +320,7 @@ namespace Ryujinx.Graphics.Vulkan
_physicalDevice.IsDeviceExtensionPresent("VK_EXT_shader_stencil_export"),
features2.Features.ShaderStorageImageMultisample,
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
isDynamicStatesupported,
features2.Features.MultiViewport && !(IsMoltenVk && Vendor == Vendor.Amd), // Workaround for AMD on MoltenVK issue
featuresRobustness2.NullDescriptor || !IsMoltenVk,
_physicalDevice.IsDeviceExtensionPresent(KhrPushDescriptor.ExtensionName),

View File

@ -1411,15 +1411,19 @@ public unsafe struct GameInfoNative
if (imageData == null || imageData.Length > 4096 * 4096)
{
throw new ArgumentException("Image data must not exceed 4 MB.");
// throw new ArgumentException("Image data must not exceed 4 MB.");
ImageSize = (uint)0;
ImageData = null;
}
else
{
ImageSize = (uint)imageData.Length;
ImageData = (byte*)Marshal.AllocHGlobal(imageData.Length);
Marshal.Copy(imageData, 0, (IntPtr)ImageData, imageData.Length);
}
}
// Don't forget to free the allocated memory
public void Dispose()