forked from MeloNX/MeloNX
Fix crash with if image data is over 4mb and other VK changes
This commit is contained in:
parent
7025c32c4a
commit
e02037d9c3
Binary file not shown.
@ -11,7 +11,7 @@ import UIKit
|
|||||||
@main
|
@main
|
||||||
struct MeloNXApp: App {
|
struct MeloNXApp: App {
|
||||||
|
|
||||||
@AppStorage("showeddrmcheck") var showed = false
|
@AppStorage("showeddrmcheck") var showed = true
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
DispatchQueue.main.async { [self] in
|
DispatchQueue.main.async { [self] in
|
||||||
@ -21,7 +21,7 @@ struct MeloNXApp: App {
|
|||||||
if bool {
|
if bool {
|
||||||
print("Yippee")
|
print("Yippee")
|
||||||
} else {
|
} else {
|
||||||
exit(0)
|
// exit(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -105,8 +105,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
SupportsConditionalRendering = supportsConditionalRendering;
|
SupportsConditionalRendering = supportsConditionalRendering;
|
||||||
SupportsExtendedDynamicState = (OperatingSystem.IsIOS() ? OperatingSystem.IsIOSVersionAtLeast(17) ? supportsExtendedDynamicState : false : supportsExtendedDynamicState);
|
SupportsExtendedDynamicState = (OperatingSystem.IsIOS() ? OperatingSystem.IsIOSVersionAtLeast(17) ? supportsExtendedDynamicState : false : supportsExtendedDynamicState);
|
||||||
SupportsMultiView = supportsMultiView;
|
SupportsMultiView = supportsMultiView;
|
||||||
SupportsNullDescriptors = (OperatingSystem.IsIOS() ? false : supportsNullDescriptors);
|
SupportsNullDescriptors = supportsNullDescriptors;
|
||||||
SupportsPushDescriptors = (OperatingSystem.IsIOS() ? false : supportsNullDescriptors);
|
SupportsPushDescriptors = supportsPushDescriptors;
|
||||||
SupportsPrimitiveTopologyListRestart = supportsPrimitiveTopologyListRestart;
|
SupportsPrimitiveTopologyListRestart = supportsPrimitiveTopologyListRestart;
|
||||||
SupportsPrimitiveTopologyPatchListRestart = supportsPrimitiveTopologyPatchListRestart;
|
SupportsPrimitiveTopologyPatchListRestart = supportsPrimitiveTopologyPatchListRestart;
|
||||||
SupportsTransformFeedback = supportsTransformFeedback;
|
SupportsTransformFeedback = supportsTransformFeedback;
|
||||||
|
@ -301,6 +301,10 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
properties.Limits.FramebufferDepthSampleCounts &
|
properties.Limits.FramebufferDepthSampleCounts &
|
||||||
properties.Limits.FramebufferStencilSampleCounts;
|
properties.Limits.FramebufferStencilSampleCounts;
|
||||||
|
|
||||||
|
bool isDynamicStateSupported = OperatingSystem.IsIOS()
|
||||||
|
? OperatingSystem.IsIOSVersionAtLeast(17) && _physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName)
|
||||||
|
: _physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName);
|
||||||
|
|
||||||
Capabilities = new HardwareCapabilities(
|
Capabilities = new HardwareCapabilities(
|
||||||
_physicalDevice.IsDeviceExtensionPresent("VK_EXT_index_type_uint8"),
|
_physicalDevice.IsDeviceExtensionPresent("VK_EXT_index_type_uint8"),
|
||||||
supportsCustomBorderColor,
|
supportsCustomBorderColor,
|
||||||
@ -316,7 +320,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
_physicalDevice.IsDeviceExtensionPresent("VK_EXT_shader_stencil_export"),
|
_physicalDevice.IsDeviceExtensionPresent("VK_EXT_shader_stencil_export"),
|
||||||
features2.Features.ShaderStorageImageMultisample,
|
features2.Features.ShaderStorageImageMultisample,
|
||||||
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
|
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
|
||||||
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
|
isDynamicStatesupported,
|
||||||
features2.Features.MultiViewport && !(IsMoltenVk && Vendor == Vendor.Amd), // Workaround for AMD on MoltenVK issue
|
features2.Features.MultiViewport && !(IsMoltenVk && Vendor == Vendor.Amd), // Workaround for AMD on MoltenVK issue
|
||||||
featuresRobustness2.NullDescriptor || !IsMoltenVk,
|
featuresRobustness2.NullDescriptor || !IsMoltenVk,
|
||||||
_physicalDevice.IsDeviceExtensionPresent(KhrPushDescriptor.ExtensionName),
|
_physicalDevice.IsDeviceExtensionPresent(KhrPushDescriptor.ExtensionName),
|
||||||
|
@ -1411,14 +1411,18 @@ public unsafe struct GameInfoNative
|
|||||||
|
|
||||||
if (imageData == null || imageData.Length > 4096 * 4096)
|
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;
|
{
|
||||||
|
ImageSize = (uint)imageData.Length;
|
||||||
|
|
||||||
ImageData = (byte*)Marshal.AllocHGlobal(imageData.Length);
|
ImageData = (byte*)Marshal.AllocHGlobal(imageData.Length);
|
||||||
|
|
||||||
Marshal.Copy(imageData, 0, (IntPtr)ImageData, imageData.Length);
|
Marshal.Copy(imageData, 0, (IntPtr)ImageData, imageData.Length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't forget to free the allocated memory
|
// Don't forget to free the allocated memory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user