Reset Ryujinx

This commit is contained in:
stossy11 2024-11-23 15:16:06 +11:00
parent 8d4f004a59
commit e170ed01ad
13 changed files with 55 additions and 99 deletions

View File

@ -19,7 +19,7 @@ namespace ARMeilleure.Translation.Cache
private const int CodeAlignment = 4; // Bytes. private const int CodeAlignment = 4; // Bytes.
private const int CacheSize = 2047 * 1024 * 1024; private const int CacheSize = 2047 * 1024 * 1024;
private const int CacheSizeIOS = 512 * 768 * 1024; private const int CacheSizeIOS = 512 * 1024 * 1024;
private static ReservedRegion _jitRegion; private static ReservedRegion _jitRegion;
private static JitCacheInvalidation _jitCacheInvalidator; private static JitCacheInvalidation _jitCacheInvalidator;

View File

@ -518,6 +518,16 @@
"$(PROJECT_DIR)/MeloNX/Dependencies", "$(PROJECT_DIR)/MeloNX/Dependencies",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries", "$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries", "$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX; PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX;
@ -571,6 +581,16 @@
"$(PROJECT_DIR)/MeloNX/Dependencies", "$(PROJECT_DIR)/MeloNX/Dependencies",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries", "$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries", "$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
"$(PROJECT_DIR)/MeloNX",
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX; PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX;

View File

@ -63,8 +63,6 @@ class Ryujinx {
self.isRunning = false self.isRunning = false
throw RyujinxError.executionError(code: result) throw RyujinxError.executionError(code: result)
} }
// Start The Emulation loop (probably not needed)
self.runEmulationLoop()
} catch { } catch {
self.isRunning = false self.isRunning = false
Self.log("Emulation failed to start: \(error)") Self.log("Emulation failed to start: \(error)")
@ -72,17 +70,6 @@ class Ryujinx {
} }
} }
private func runEmulationLoop() {
let runLoop = RunLoop.current
let port = Port()
runLoop.add(port, forMode: .default)
while isRunning && runLoop.run(mode: .default, before: .distantFuture) {
autoreleasepool { }
}
Self.log("Emulation loop ended")
}
func stop() throws { func stop() throws {
guard isRunning else { guard isRunning else {
@ -109,9 +96,9 @@ class Ryujinx {
args.append(contentsOf: ["--memory-manager-mode", "SoftwarePageTable"]) args.append(contentsOf: ["--memory-manager-mode", "SoftwarePageTable"])
if config.fullscreen { if config.fullscreen {
// args.append(contentsOf: ["--fullscreen", String(config.fullscreen)]) // args.append(contentsOf: ["--fullscreen", String(config.fullscreen)])
args.append(contentsOf: ["--exclusive-fullscreen", String(config.fullscreen)]) //args.append(contentsOf: ["--exclusive-fullscreen", String(config.fullscreen)])
args.append(contentsOf: ["--exclusive-fullscreen-width", "1280"]) // args.append(contentsOf: ["--exclusive-fullscreen-width", "1280"])
args.append(contentsOf: ["--exclusive-fullscreen-height", "720"]) // args.append(contentsOf: ["--exclusive-fullscreen-height", "720"])
// exclusive-fullscreen // exclusive-fullscreen
} }
// Debug Logs // Debug Logs

View File

@ -40,7 +40,7 @@ struct ContentView: View {
let controller = GCVirtualController(configuration: configuration) let controller = GCVirtualController(configuration: configuration)
self.virtualController = controller self.virtualController = controller
controller.connect() self.virtualController?.connect()
} }
var body: some View { var body: some View {
@ -91,13 +91,13 @@ struct ContentView: View {
gamepath: game!.path, gamepath: game!.path,
additionalArgs: [ additionalArgs: [
// "--display-id", String(displayid) // "--display-id", String(displayid)
"--expand-ram", "false"
], ],
debuglogs: true, debuglogs: true,
tracelogs: true, tracelogs: true,
listinputids: false, listinputids: false,
inputids: [], // "1-1fd70005-057e-0000-0920-0000ff870000"], // "2-1fd70005-057e-0000-0920-0000ff870000"], inputids: ["1-1fd70005-057e-0000-0920-0000ff870000"], // "2-1fd70005-057e-0000-0920-0000ff870000"],
ryufullscreen: true ryufullscreen: false
) )
@ -126,15 +126,15 @@ struct ContentView: View {
let settings: [String: String] = [ let settings: [String: String] = [
"MVK_DEBUG": "0", "MVK_DEBUG": "1",
"MVK_CONFIG_DEBUG": "1", "MVK_CONFIG_DEBUG": "1",
// "MVK_CONFIG_PREALLOCATE_DESCRIPTORS": "1", "MVK_CONFIG_PREALLOCATE_DESCRIPTORS": "1",
// "MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE": "1", // "MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE": "1",
// "MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS": "1", "MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS": "3",
"MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE": "512", "MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE": "512",
"MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS": "1", "MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS": "1",
"MVK_USE_METAL_PRIVATE_API": "1", "MVK_USE_METAL_PRIVATE_API": "1",
// "MVK_CONFIG_RESUME_LOST_DEVICE": "1", "MVK_CONFIG_RESUME_LOST_DEVICE": "1",
"MVK_CONFIG_USE_METAL_PRIVATE_API": "1", "MVK_CONFIG_USE_METAL_PRIVATE_API": "1",
// "MVK_CONFIG_ALLOW_METAL_NON_STANDARD_IMAGE_COPIES": "1" // "MVK_CONFIG_ALLOW_METAL_NON_STANDARD_IMAGE_COPIES": "1"
] ]
@ -150,16 +150,9 @@ extension UIWindow {
@objc func wdb_makeKeyAndVisible() { @objc func wdb_makeKeyAndVisible() {
print("Making window key and visible...") print("Making window key and visible...")
if #available(iOS 13.0, *) {
self.windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene self.windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
}
self.wdb_makeKeyAndVisible() self.wdb_makeKeyAndVisible()
// Update ContentView's reference to this window instance
if let rootView = self.rootViewController as? UIHostingController<ContentView> {
rootView.rootView.theWindow = self
}
} }
} }

View File

@ -48,37 +48,12 @@ namespace Ryujinx.Graphics.Vulkan
} }
public unsafe void UpdateBuffers(int setIndex, int baseBinding, ReadOnlySpan<DescriptorBufferInfo> bufferInfo, DescriptorType type) public unsafe void UpdateBuffers(int setIndex, int baseBinding, ReadOnlySpan<DescriptorBufferInfo> bufferInfo, DescriptorType type)
{ {
// DEBUG: Validate inputs
if (bufferInfo.Length == 0) if (bufferInfo.Length == 0)
{ {
Console.WriteLine("bufferInfo is empty.");
return; return;
} }
// DEBUG: Check if _descriptorSets and _holder.Device are properly initialized
if (_descriptorSets == null || _descriptorSets.Length <= setIndex)
{
throw new Exception("Descriptor set at the specified index is null or out of range.");
}
if (_holder?.Device == null)
{
throw new Exception("_holder.Device is null or uninitialized.");
}
// DEBUG: Check each DescriptorBufferInfo in the span
foreach (var info in bufferInfo)
{
if (info.Buffer.Handle == 0)
{
return;
// throw new Exception("One of the buffers in bufferInfo is null or uninitialized.");
}
}
// Proceed if all checks pass
fixed (DescriptorBufferInfo* pBufferInfo = bufferInfo) fixed (DescriptorBufferInfo* pBufferInfo = bufferInfo)
{ {
var writeDescriptorSet = new WriteDescriptorSet var writeDescriptorSet = new WriteDescriptorSet
@ -88,19 +63,17 @@ namespace Ryujinx.Graphics.Vulkan
DstBinding = (uint)baseBinding, DstBinding = (uint)baseBinding,
DescriptorType = type, DescriptorType = type,
DescriptorCount = (uint)bufferInfo.Length, DescriptorCount = (uint)bufferInfo.Length,
PBufferInfo = pBufferInfo PBufferInfo = pBufferInfo,
}; };
// Update descriptor sets
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null);
} }
} }
public unsafe void UpdateImage(int setIndex, int bindingIndex, DescriptorImageInfo imageInfo, DescriptorType type) public unsafe void UpdateImage(int setIndex, int bindingIndex, DescriptorImageInfo imageInfo, DescriptorType type)
{ {
if (imageInfo.ImageView.Handle != 0UL) if (imageInfo.ImageView.Handle != 0UL)
{ {
var writeDescriptorSet = new WriteDescriptorSet var writeDescriptorSet = new WriteDescriptorSet
{ {
SType = StructureType.WriteDescriptorSet, SType = StructureType.WriteDescriptorSet,
@ -117,23 +90,11 @@ namespace Ryujinx.Graphics.Vulkan
public unsafe void UpdateImages(int setIndex, int baseBinding, ReadOnlySpan<DescriptorImageInfo> imageInfo, DescriptorType type) public unsafe void UpdateImages(int setIndex, int baseBinding, ReadOnlySpan<DescriptorImageInfo> imageInfo, DescriptorType type)
{ {
// DEBUG: Check if imageInfo is Empty
if (imageInfo.Length == 0) if (imageInfo.Length == 0)
{ {
Console.WriteLine("Error: imageInfo is empty.");
return; return;
} }
// DEBUG: Check the values inside imageInfo
foreach (var info in imageInfo)
{
Console.WriteLine($"Buffer Handle: {info.ImageView.Handle}");
}
Console.WriteLine($"BaseBinding: {baseBinding}, Type: {type}, ImageInfo Length: {imageInfo.Length}");
fixed (DescriptorImageInfo* pImageInfo = imageInfo) fixed (DescriptorImageInfo* pImageInfo = imageInfo)
{ {
var writeDescriptorSet = new WriteDescriptorSet var writeDescriptorSet = new WriteDescriptorSet
@ -146,8 +107,6 @@ namespace Ryujinx.Graphics.Vulkan
PImageInfo = pImageInfo, PImageInfo = pImageInfo,
}; };
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null);
} }
} }

View File

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

View File

@ -107,7 +107,7 @@ namespace Ryujinx.Graphics.Vulkan
_shaders = internalShaders; _shaders = internalShaders;
bool usePushDescriptors = /*!isMinimal && VulkanConfiguration.UsePushDescriptors &&*/ _gd.Capabilities.SupportsPushDescriptors; bool usePushDescriptors = !isMinimal && VulkanConfiguration.UsePushDescriptors && _gd.Capabilities.SupportsPushDescriptors;
_plce = gd.PipelineLayoutCache.GetOrCreate(gd, device, resourceLayout.Sets, usePushDescriptors); _plce = gd.PipelineLayoutCache.GetOrCreate(gd, device, resourceLayout.Sets, usePushDescriptors);

View File

@ -423,7 +423,7 @@ namespace Ryujinx.Graphics.Vulkan
{ {
SType = StructureType.PhysicalDeviceRobustness2FeaturesExt, SType = StructureType.PhysicalDeviceRobustness2FeaturesExt,
PNext = pExtendedFeatures, PNext = pExtendedFeatures,
// NullDescriptor = supportedFeaturesRobustness2.NullDescriptor, NullDescriptor = supportedFeaturesRobustness2.NullDescriptor,
}; };
pExtendedFeatures = &featuresRobustness2; pExtendedFeatures = &featuresRobustness2;

View File

@ -185,7 +185,6 @@ namespace Ryujinx.Headless.SDL2
FullscreenFlag = SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP; FullscreenFlag = SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
} }
// WindowHandle = SDL_GetWindowFromID(1);
WindowHandle = SDL_CreateWindow($"Ryujinx {Program.Version}{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}", SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), Width, Height, DefaultFlags | FullscreenFlag | GetWindowFlags()); WindowHandle = SDL_CreateWindow($"Ryujinx {Program.Version}{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}", SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), Width, Height, DefaultFlags | FullscreenFlag | GetWindowFlags());
if (WindowHandle == IntPtr.Zero) if (WindowHandle == IntPtr.Zero)