forked from MeloNX/MeloNX
Fix Descriptor Issues
This commit is contained in:
parent
b9163f9fde
commit
0a3b4f71a9
Binary file not shown.
@ -106,8 +106,12 @@ class Ryujinx {
|
||||
args.append(contentsOf: ["--disable-shader-cache", "true"])
|
||||
args.append(contentsOf: ["--disable-docked-mode", "true"])
|
||||
args.append(contentsOf: ["--enable-texture-recompression", "true"])
|
||||
args.append(contentsOf: ["--enable-debug-logs", String(config.debuglogs)])
|
||||
args.append(contentsOf: ["--enable-trace-logs", String(config.tracelogs)])
|
||||
if config.debuglogs {
|
||||
args.append(contentsOf: ["--enable-debug-logs", String(config.debuglogs)])
|
||||
}
|
||||
if config.tracelogs {
|
||||
args.append(contentsOf: ["--enable-trace-logs", String(config.tracelogs)])
|
||||
}
|
||||
|
||||
// List the input ids
|
||||
if config.listinputids {
|
||||
@ -117,7 +121,7 @@ class Ryujinx {
|
||||
// Append the input ids (limit to 4 just in case)
|
||||
if !config.inputids.isEmpty {
|
||||
config.inputids.prefix(4).enumerated().forEach { index, inputId in
|
||||
// args.append(contentsOf: ["--input-id-\(index + 1)", inputId])
|
||||
args.append(contentsOf: ["--input-id-\(index + 1)", inputId])
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -9,20 +9,32 @@ import SwiftUI
|
||||
import SDL2
|
||||
import GameController
|
||||
|
||||
struct MoltenVKSettings: Codable, Hashable {
|
||||
let string: String
|
||||
var value: String
|
||||
}
|
||||
|
||||
struct ContentView: View {
|
||||
@State public var theWindow: UIWindow? = nil
|
||||
@State private var virtualController: GCVirtualController?
|
||||
@State var game: URL? = nil
|
||||
@State var controllerss: [Controller] = []
|
||||
|
||||
@State private var settings: [MoltenVKSettings] = [
|
||||
MoltenVKSettings(string: "MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS", value: "0"),
|
||||
MoltenVKSettings(string: "MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS", value: "0"),
|
||||
MoltenVKSettings(string: "MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE", value: "1024"),
|
||||
MoltenVKSettings(string: "MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS", value: "0"),
|
||||
MoltenVKSettings(string: "MVK_CONFIG_RESUME_LOST_DEVICE", value: "1")
|
||||
]
|
||||
|
||||
init() {
|
||||
setMoltenVKSettings()
|
||||
// Initialize SDL
|
||||
DispatchQueue.main.async { [self] in
|
||||
setMoltenVKSettings()
|
||||
SDL_SetMainReady()
|
||||
SDL_iPhoneSetEventPump(SDL_TRUE)
|
||||
SDL_Init(SDL_INIT_VIDEO)
|
||||
|
||||
patchMakeKeyAndVisible()
|
||||
}
|
||||
}
|
||||
@ -62,30 +74,22 @@ struct ContentView: View {
|
||||
.onAppear() {
|
||||
Ryujinx().getConnectedControllers()
|
||||
}
|
||||
/*
|
||||
|
||||
List {
|
||||
ForEach(Ryujinx().controllerMap) { controllers in
|
||||
Button {
|
||||
if controllerss.contains(where: { $0.id == controllers.id }) {
|
||||
controllerss.removeAll(where: { $0.id == controllers.id })
|
||||
} else {
|
||||
controllerss.append(controllers)
|
||||
}
|
||||
} label: {
|
||||
if controllerss.contains(where: { $0.id == controllers.id }) {
|
||||
HStack {
|
||||
Text(controllers.name)
|
||||
Spacer()
|
||||
Text("enabled")
|
||||
ForEach($settings, id: \.self) { $setting in
|
||||
HStack {
|
||||
Text(setting.string)
|
||||
.padding()
|
||||
TextField("Value", text: $setting.value)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
.onChange(of: setting.value) { newValue in
|
||||
setenv(setting.string, newValue, 1)
|
||||
}
|
||||
} else {
|
||||
Text(controllers.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -100,7 +104,7 @@ struct ContentView: View {
|
||||
debuglogs: false,
|
||||
tracelogs: 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
|
||||
|
||||
)
|
||||
@ -128,27 +132,9 @@ struct ContentView: View {
|
||||
|
||||
|
||||
private func setMoltenVKSettings() {
|
||||
|
||||
|
||||
let settings: [String: String] = [
|
||||
"MVK_DEBUG": "1",
|
||||
"MVK_CONFIG_DEBUG": "1",
|
||||
"MVK_CONFIG_PREALLOCATE_DESCRIPTORS": "1",
|
||||
"MVK_CONFIG_TEXTURE_1D_AS_2D": "0",
|
||||
"MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS": "0",
|
||||
"MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS": "3",
|
||||
"MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE": "512",
|
||||
"MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS": "1",
|
||||
"MVK_USE_METAL_PRIVATE_API": "1",
|
||||
"MVK_CONFIG_RESUME_LOST_DEVICE": "1",
|
||||
"MVK_CONFIG_USE_METAL_PRIVATE_API": "1",
|
||||
// "MVK_CONFIG_ALLOW_METAL_NON_STANDARD_IMAGE_COPIES": "1"
|
||||
]
|
||||
|
||||
settings.forEach { strins in
|
||||
setenv(strins.key, strins.value, 1)
|
||||
settings.forEach { setting in
|
||||
setenv(setting.string, setting.value, 1)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
{
|
||||
Console.WriteLine($"Buffer Handle: {info.ImageView.Handle}");
|
||||
}
|
||||
Console.WriteLine($"SetIndex: {setIndex}, BaseBinding: {baseBinding}, DescriptorType: {type}, ImageInfo Count: {imageInfo.Length}");
|
||||
|
||||
|
||||
fixed (DescriptorImageInfo* pImageInfo = imageInfo)
|
||||
@ -140,7 +141,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
DstSet = _descriptorSets[setIndex],
|
||||
DstBinding = (uint)baseBinding,
|
||||
DescriptorType = type,
|
||||
DescriptorCount = (uint)1,
|
||||
DescriptorCount = (uint)imageInfo.Length,
|
||||
PImageInfo = pImageInfo,
|
||||
};
|
||||
|
||||
@ -179,7 +180,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
DstSet = _descriptorSets[setIndex],
|
||||
DstBinding = (uint)(baseBinding + i),
|
||||
DescriptorType = DescriptorType.CombinedImageSampler,
|
||||
DescriptorCount = (uint)count,
|
||||
DescriptorCount = 1,
|
||||
PImageInfo = pImageInfo,
|
||||
};
|
||||
|
||||
@ -235,7 +236,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
DstSet = _descriptorSets[setIndex],
|
||||
DstBinding = (uint)baseBinding + i,
|
||||
DescriptorType = type,
|
||||
DescriptorCount = count,
|
||||
DescriptorCount = 1,
|
||||
PTexelBufferView = pTexelBufferView + i,
|
||||
};
|
||||
|
||||
|
@ -110,7 +110,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
_textures.AsSpan().Fill(initialImageInfo);
|
||||
_images.AsSpan().Fill(initialImageInfo);
|
||||
|
||||
if (gd.Capabilities.SupportsNullDescriptors)
|
||||
if (gd.Capabilities.SupportsNullDescriptors && !OperatingSystem.IsIOS())
|
||||
{
|
||||
// If null descriptors are supported, we can pass null as the handle.
|
||||
_dummyBuffer = null;
|
||||
@ -580,9 +580,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
{
|
||||
texture.Sampler = _dummySampler.GetSampler().Get(cbs).Value;
|
||||
}
|
||||
|
||||
Span<DescriptorImageInfo> singleTexture = textures.Slice(i, 1);
|
||||
dsc.UpdateImages(0, binding + i, singleTexture, DescriptorType.CombinedImageSampler);
|
||||
}
|
||||
|
||||
dsc.UpdateImages(0, binding, textures[..count], DescriptorType.CombinedImageSampler);
|
||||
// dsc.UpdateImages(0, binding, textures[..count], DescriptorType.CombinedImageSampler);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -605,9 +608,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
images[i].ImageView = _imageRefs[binding + i]?.Get(cbs).Value ?? default;
|
||||
Span<DescriptorImageInfo> singleImage = images.Slice(i, 1);
|
||||
dsc.UpdateImages(0, binding + i, singleImage, DescriptorType.StorageImage);
|
||||
}
|
||||
|
||||
dsc.UpdateImages(0, binding, images[..count], DescriptorType.StorageImage);
|
||||
// dsc.UpdateImages(0, binding, images[..count], DescriptorType.StorageImage);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -318,7 +318,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
|
||||
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
|
||||
features2.Features.MultiViewport && !(IsMoltenVk && Vendor == Vendor.Amd), // Workaround for AMD on MoltenVK issue
|
||||
featuresRobustness2.NullDescriptor || IsMoltenVk,
|
||||
featuresRobustness2.NullDescriptor || !IsMoltenVk,
|
||||
_physicalDevice.IsDeviceExtensionPresent(KhrPushDescriptor.ExtensionName),
|
||||
featuresPrimitiveTopologyListRestart.PrimitiveTopologyListRestart,
|
||||
featuresPrimitiveTopologyListRestart.PrimitiveTopologyPatchListRestart,
|
||||
|
Loading…
x
Reference in New Issue
Block a user