forked from MeloNX/MeloNX
Bring back old changes and enable Metal Argument Buffers
This commit is contained in:
parent
05d1730c17
commit
b9163f9fde
src
MeloNX
MeloNX.xcodeproj
MeloNX
Ryujinx.Graphics.Vulkan
Ryujinx.Headless.SDL2
@ -528,6 +528,9 @@
|
|||||||
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
"$(PROJECT_DIR)/MeloNX",
|
"$(PROJECT_DIR)/MeloNX",
|
||||||
"$(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",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX;
|
PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX;
|
||||||
@ -591,6 +594,9 @@
|
|||||||
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
"$(PROJECT_DIR)/MeloNX",
|
"$(PROJECT_DIR)/MeloNX",
|
||||||
"$(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",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX;
|
PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX;
|
||||||
|
BIN
src/MeloNX/MeloNX.xcodeproj/project.xcworkspace/xcuserdata/stossy11.xcuserdatad/UserInterfaceState.xcuserstate
generated
BIN
src/MeloNX/MeloNX.xcodeproj/project.xcworkspace/xcuserdata/stossy11.xcuserdatad/UserInterfaceState.xcuserstate
generated
Binary file not shown.
@ -58,7 +58,6 @@
|
|||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
enableAddressSanitizer = "YES"
|
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
useCustomWorkingDirectory = "NO"
|
useCustomWorkingDirectory = "NO"
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
Binary file not shown.
@ -47,10 +47,15 @@ struct ContentView: View {
|
|||||||
|
|
||||||
|
|
||||||
if let game {
|
if let game {
|
||||||
Text("Loading...")
|
ZStack {
|
||||||
.onAppear {
|
SDLViewRepresentable { displayid in
|
||||||
start(displayid: 0)
|
start(displayid: 0)
|
||||||
}
|
}
|
||||||
|
Text("Loading...")
|
||||||
|
.onAppear {
|
||||||
|
// start(displayid: 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
HStack {
|
HStack {
|
||||||
GameListView(startemu: $game)
|
GameListView(startemu: $game)
|
||||||
@ -92,10 +97,10 @@ struct ContentView: View {
|
|||||||
additionalArgs: [
|
additionalArgs: [
|
||||||
// "--display-id", String(displayid)
|
// "--display-id", String(displayid)
|
||||||
],
|
],
|
||||||
debuglogs: true,
|
debuglogs: false,
|
||||||
tracelogs: true,
|
tracelogs: false,
|
||||||
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: true
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -129,7 +134,8 @@ struct ContentView: View {
|
|||||||
"MVK_DEBUG": "1",
|
"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_TEXTURE_1D_AS_2D": "0",
|
||||||
|
"MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS": "0",
|
||||||
"MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS": "3",
|
"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",
|
||||||
@ -140,7 +146,7 @@ struct ContentView: View {
|
|||||||
]
|
]
|
||||||
|
|
||||||
settings.forEach { strins in
|
settings.forEach { strins in
|
||||||
setenv(strins.key, strins.value, 1)
|
setenv(strins.key, strins.value, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,32 +48,58 @@ 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)
|
||||||
|
{
|
||||||
|
Console.WriteLine("bufferInfo is empty.");
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
if (bufferInfo.Length == 0)
|
throw new Exception("One of the buffers in bufferInfo is null or uninitialized.");
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fixed (DescriptorBufferInfo* pBufferInfo = bufferInfo)
|
|
||||||
{
|
|
||||||
var writeDescriptorSet = new WriteDescriptorSet
|
|
||||||
{
|
|
||||||
SType = StructureType.WriteDescriptorSet,
|
|
||||||
DstSet = _descriptorSets[setIndex],
|
|
||||||
DstBinding = (uint)baseBinding,
|
|
||||||
DescriptorType = type,
|
|
||||||
DescriptorCount = (uint)bufferInfo.Length,
|
|
||||||
PBufferInfo = pBufferInfo,
|
|
||||||
};
|
|
||||||
|
|
||||||
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Proceed if all checks pass
|
||||||
|
fixed (DescriptorBufferInfo* pBufferInfo = bufferInfo)
|
||||||
|
{
|
||||||
|
var writeDescriptorSet = new WriteDescriptorSet
|
||||||
|
{
|
||||||
|
SType = StructureType.WriteDescriptorSet,
|
||||||
|
DstSet = _descriptorSets[setIndex],
|
||||||
|
DstBinding = (uint)baseBinding,
|
||||||
|
DescriptorType = type,
|
||||||
|
DescriptorCount = (uint)bufferInfo.Length,
|
||||||
|
PBufferInfo = pBufferInfo
|
||||||
|
};
|
||||||
|
|
||||||
|
// Update descriptor sets
|
||||||
|
_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,
|
||||||
@ -90,11 +116,22 @@ 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}");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fixed (DescriptorImageInfo* pImageInfo = imageInfo)
|
fixed (DescriptorImageInfo* pImageInfo = imageInfo)
|
||||||
{
|
{
|
||||||
var writeDescriptorSet = new WriteDescriptorSet
|
var writeDescriptorSet = new WriteDescriptorSet
|
||||||
@ -103,10 +140,12 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
DstSet = _descriptorSets[setIndex],
|
DstSet = _descriptorSets[setIndex],
|
||||||
DstBinding = (uint)baseBinding,
|
DstBinding = (uint)baseBinding,
|
||||||
DescriptorType = type,
|
DescriptorType = type,
|
||||||
DescriptorCount = (uint)imageInfo.Length,
|
DescriptorCount = (uint)1,
|
||||||
PImageInfo = pImageInfo,
|
PImageInfo = pImageInfo,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null);
|
_holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,18 +103,18 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
SupportsShaderStencilExport = supportsShaderStencilExport;
|
SupportsShaderStencilExport = supportsShaderStencilExport;
|
||||||
SupportsShaderStorageImageMultisample = supportsShaderStorageImageMultisample;
|
SupportsShaderStorageImageMultisample = supportsShaderStorageImageMultisample;
|
||||||
SupportsConditionalRendering = supportsConditionalRendering;
|
SupportsConditionalRendering = supportsConditionalRendering;
|
||||||
SupportsExtendedDynamicState = false;
|
SupportsExtendedDynamicState = supportsExtendedDynamicState;
|
||||||
SupportsMultiView = supportsMultiView;
|
SupportsMultiView = supportsMultiView;
|
||||||
SupportsNullDescriptors = (OperatingSystem.IsIOS() ? false : supportsNullDescriptors);
|
SupportsNullDescriptors = (OperatingSystem.IsIOS() ? false : supportsNullDescriptors);
|
||||||
SupportsPushDescriptors = (OperatingSystem.IsIOS() ? false : SupportsPushDescriptors);
|
SupportsPushDescriptors = (OperatingSystem.IsIOS() ? false : supportsPushDescriptors);
|
||||||
SupportsPrimitiveTopologyListRestart = supportsPrimitiveTopologyListRestart;
|
SupportsPrimitiveTopologyListRestart = supportsPrimitiveTopologyListRestart;
|
||||||
SupportsPrimitiveTopologyPatchListRestart = supportsPrimitiveTopologyPatchListRestart;
|
SupportsPrimitiveTopologyPatchListRestart = supportsPrimitiveTopologyPatchListRestart;
|
||||||
SupportsTransformFeedback = false;
|
SupportsTransformFeedback = supportsTransformFeedback;
|
||||||
SupportsTransformFeedbackQueries = supportsTransformFeedbackQueries;
|
SupportsTransformFeedbackQueries = supportsTransformFeedbackQueries;
|
||||||
SupportsPreciseOcclusionQueries = supportsPreciseOcclusionQueries;
|
SupportsPreciseOcclusionQueries = supportsPreciseOcclusionQueries;
|
||||||
SupportsPipelineStatisticsQuery = supportsPipelineStatisticsQuery;
|
SupportsPipelineStatisticsQuery = supportsPipelineStatisticsQuery;
|
||||||
SupportsGeometryShader = false;
|
SupportsGeometryShader = supportsGeometryShader;
|
||||||
SupportsTessellationShader = false;
|
SupportsTessellationShader = supportsTessellationShader;
|
||||||
SupportsViewportArray2 = supportsViewportArray2;
|
SupportsViewportArray2 = supportsViewportArray2;
|
||||||
SupportsHostImportedMemory = supportsHostImportedMemory;
|
SupportsHostImportedMemory = supportsHostImportedMemory;
|
||||||
SupportsDepthClipControl = supportsDepthClipControl;
|
SupportsDepthClipControl = supportsDepthClipControl;
|
||||||
|
@ -185,7 +185,8 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
FullscreenFlag = SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
FullscreenFlag = SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
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_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());
|
||||||
|
|
||||||
if (WindowHandle == IntPtr.Zero)
|
if (WindowHandle == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user