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-shader-cache", "true"])
|
||||||
args.append(contentsOf: ["--disable-docked-mode", "true"])
|
args.append(contentsOf: ["--disable-docked-mode", "true"])
|
||||||
args.append(contentsOf: ["--enable-texture-recompression", "true"])
|
args.append(contentsOf: ["--enable-texture-recompression", "true"])
|
||||||
args.append(contentsOf: ["--enable-debug-logs", String(config.debuglogs)])
|
if config.debuglogs {
|
||||||
args.append(contentsOf: ["--enable-trace-logs", String(config.tracelogs)])
|
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
|
// List the input ids
|
||||||
if config.listinputids {
|
if config.listinputids {
|
||||||
@ -117,7 +121,7 @@ class Ryujinx {
|
|||||||
// Append the input ids (limit to 4 just in case)
|
// Append the input ids (limit to 4 just in case)
|
||||||
if !config.inputids.isEmpty {
|
if !config.inputids.isEmpty {
|
||||||
config.inputids.prefix(4).enumerated().forEach { index, inputId in
|
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 SDL2
|
||||||
import GameController
|
import GameController
|
||||||
|
|
||||||
|
struct MoltenVKSettings: Codable, Hashable {
|
||||||
|
let string: String
|
||||||
|
var value: String
|
||||||
|
}
|
||||||
|
|
||||||
struct ContentView: View {
|
struct ContentView: View {
|
||||||
@State public var theWindow: UIWindow? = nil
|
@State public var theWindow: UIWindow? = nil
|
||||||
@State private var virtualController: GCVirtualController?
|
@State private var virtualController: GCVirtualController?
|
||||||
@State var game: URL? = nil
|
@State var game: URL? = nil
|
||||||
@State var controllerss: [Controller] = []
|
@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() {
|
init() {
|
||||||
setMoltenVKSettings()
|
|
||||||
// Initialize SDL
|
// Initialize SDL
|
||||||
DispatchQueue.main.async { [self] in
|
DispatchQueue.main.async { [self] in
|
||||||
|
setMoltenVKSettings()
|
||||||
SDL_SetMainReady()
|
SDL_SetMainReady()
|
||||||
SDL_iPhoneSetEventPump(SDL_TRUE)
|
SDL_iPhoneSetEventPump(SDL_TRUE)
|
||||||
SDL_Init(SDL_INIT_VIDEO)
|
SDL_Init(SDL_INIT_VIDEO)
|
||||||
|
|
||||||
patchMakeKeyAndVisible()
|
patchMakeKeyAndVisible()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,30 +74,22 @@ struct ContentView: View {
|
|||||||
.onAppear() {
|
.onAppear() {
|
||||||
Ryujinx().getConnectedControllers()
|
Ryujinx().getConnectedControllers()
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
List {
|
List {
|
||||||
ForEach(Ryujinx().controllerMap) { controllers in
|
ForEach($settings, id: \.self) { $setting in
|
||||||
Button {
|
HStack {
|
||||||
if controllerss.contains(where: { $0.id == controllers.id }) {
|
Text(setting.string)
|
||||||
controllerss.removeAll(where: { $0.id == controllers.id })
|
.padding()
|
||||||
} else {
|
TextField("Value", text: $setting.value)
|
||||||
controllerss.append(controllers)
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||||
}
|
.onChange(of: setting.value) { newValue in
|
||||||
} label: {
|
setenv(setting.string, newValue, 1)
|
||||||
if controllerss.contains(where: { $0.id == controllers.id }) {
|
|
||||||
HStack {
|
|
||||||
Text(controllers.name)
|
|
||||||
Spacer()
|
|
||||||
Text("enabled")
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Text(controllers.name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -100,7 +104,7 @@ struct ContentView: View {
|
|||||||
debuglogs: false,
|
debuglogs: false,
|
||||||
tracelogs: false,
|
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
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -128,27 +132,9 @@ struct ContentView: View {
|
|||||||
|
|
||||||
|
|
||||||
private func setMoltenVKSettings() {
|
private func setMoltenVKSettings() {
|
||||||
|
settings.forEach { setting in
|
||||||
|
setenv(setting.string, setting.value, 1)
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,6 +130,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
Console.WriteLine($"Buffer Handle: {info.ImageView.Handle}");
|
Console.WriteLine($"Buffer Handle: {info.ImageView.Handle}");
|
||||||
}
|
}
|
||||||
|
Console.WriteLine($"SetIndex: {setIndex}, BaseBinding: {baseBinding}, DescriptorType: {type}, ImageInfo Count: {imageInfo.Length}");
|
||||||
|
|
||||||
|
|
||||||
fixed (DescriptorImageInfo* pImageInfo = imageInfo)
|
fixed (DescriptorImageInfo* pImageInfo = imageInfo)
|
||||||
@ -140,7 +141,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
DstSet = _descriptorSets[setIndex],
|
DstSet = _descriptorSets[setIndex],
|
||||||
DstBinding = (uint)baseBinding,
|
DstBinding = (uint)baseBinding,
|
||||||
DescriptorType = type,
|
DescriptorType = type,
|
||||||
DescriptorCount = (uint)1,
|
DescriptorCount = (uint)imageInfo.Length,
|
||||||
PImageInfo = pImageInfo,
|
PImageInfo = pImageInfo,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -179,7 +180,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
DstSet = _descriptorSets[setIndex],
|
DstSet = _descriptorSets[setIndex],
|
||||||
DstBinding = (uint)(baseBinding + i),
|
DstBinding = (uint)(baseBinding + i),
|
||||||
DescriptorType = DescriptorType.CombinedImageSampler,
|
DescriptorType = DescriptorType.CombinedImageSampler,
|
||||||
DescriptorCount = (uint)count,
|
DescriptorCount = 1,
|
||||||
PImageInfo = pImageInfo,
|
PImageInfo = pImageInfo,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -235,7 +236,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
DstSet = _descriptorSets[setIndex],
|
DstSet = _descriptorSets[setIndex],
|
||||||
DstBinding = (uint)baseBinding + i,
|
DstBinding = (uint)baseBinding + i,
|
||||||
DescriptorType = type,
|
DescriptorType = type,
|
||||||
DescriptorCount = count,
|
DescriptorCount = 1,
|
||||||
PTexelBufferView = pTexelBufferView + i,
|
PTexelBufferView = pTexelBufferView + i,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
_textures.AsSpan().Fill(initialImageInfo);
|
_textures.AsSpan().Fill(initialImageInfo);
|
||||||
_images.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.
|
// If null descriptors are supported, we can pass null as the handle.
|
||||||
_dummyBuffer = null;
|
_dummyBuffer = null;
|
||||||
@ -580,9 +580,12 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
texture.Sampler = _dummySampler.GetSampler().Get(cbs).Value;
|
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
|
else
|
||||||
{
|
{
|
||||||
@ -605,9 +608,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
images[i].ImageView = _imageRefs[binding + i]?.Get(cbs).Value ?? default;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -318,7 +318,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
|
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
|
||||||
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
|
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
|
||||||
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),
|
||||||
featuresPrimitiveTopologyListRestart.PrimitiveTopologyListRestart,
|
featuresPrimitiveTopologyListRestart.PrimitiveTopologyListRestart,
|
||||||
featuresPrimitiveTopologyListRestart.PrimitiveTopologyPatchListRestart,
|
featuresPrimitiveTopologyListRestart.PrimitiveTopologyPatchListRestart,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user