diff --git a/Ryujinx.Graphics.Gpu/GraphicsConfig.cs b/Ryujinx.Graphics.Gpu/GraphicsConfig.cs index 9f9de50f6..70df1ca72 100644 --- a/Ryujinx.Graphics.Gpu/GraphicsConfig.cs +++ b/Ryujinx.Graphics.Gpu/GraphicsConfig.cs @@ -30,8 +30,8 @@ namespace Ryujinx.Graphics.Gpu /// /// Enables or disables fast 2d engine texture copies entirely on CPU when possible. - /// Reduces stuttering and # of textures in games that copy textures around for streaming, - /// as textures will not need to be created for the copy, and the data does not need to be + /// Reduces stuttering and # of textures in games that copy textures around for streaming, + /// as textures will not need to be created for the copy, and the data does not need to be /// flushed from GPU. /// public static bool Fast2DCopy = true; diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs index 8dcd0ac12..c3402c582 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs @@ -43,6 +43,10 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl context.AppendLine("#extension GL_INTEL_fragment_shader_ordering : enable"); } } + else + { + context.AppendLine("#extension GL_ARB_shader_viewport_layer_array : enable"); + } if (context.Config.GpPassthrough) { diff --git a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs index e9799f48a..7ceca154d 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs @@ -1300,8 +1300,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv shift = context.ShiftLeftLogical(context.TypeU32(), shift, context.Constant(context.TypeU32(), (SpvLiteralInteger)1)); var lutIdx = context.ShiftRightLogical(context.TypeU32(), mask, shift); - var xLutValue = context.AccessChain(context.TypeFP32(), xLut, lutIdx); - var yLutValue = context.AccessChain(context.TypeFP32(), yLut, lutIdx); + var xLutValue = context.VectorExtractDynamic(context.TypeFP32(), xLut, lutIdx); + var yLutValue = context.VectorExtractDynamic(context.TypeFP32(), yLut, lutIdx); var xResult = context.FMul(context.TypeFP32(), x, xLutValue); var yResult = context.FMul(context.TypeFP32(), y, yLutValue); @@ -1465,7 +1465,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv } var vectorType = context.TypeVector(context.TypeS32(), count); - + return context.ConstantComposite(vectorType, elems); } else diff --git a/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs b/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs index 6554386c5..68aad266c 100644 --- a/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs +++ b/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs @@ -28,9 +28,11 @@ namespace Ryujinx.Graphics.Vulkan ExtConditionalRendering.ExtensionName, ExtExtendedDynamicState.ExtensionName, KhrDrawIndirectCount.ExtensionName, - "VK_EXT_index_type_uint8", "VK_EXT_custom_border_color", - "VK_EXT_robustness2" + "VK_EXT_fragment_shader_interlock", + "VK_EXT_index_type_uint8", + "VK_EXT_robustness2", + "VK_EXT_shader_subgroup_ballot" }; private static readonly string[] _excludedMessages = new string[] @@ -340,6 +342,7 @@ namespace Ryujinx.Graphics.Vulkan PipelineStatisticsQuery = true, SamplerAnisotropy = true, ShaderClipDistance = true, + ShaderFloat64 = true, ShaderImageGatherExtended = true, // ShaderStorageImageReadWithoutFormat = true, // ShaderStorageImageWriteWithoutFormat = true, @@ -388,6 +391,13 @@ namespace Ryujinx.Graphics.Vulkan DrawIndirectCount = supportedExtensions.Contains(KhrDrawIndirectCount.ExtensionName) }; + var featuresFragmentShaderInterlock = new PhysicalDeviceFragmentShaderInterlockFeaturesEXT() + { + SType = StructureType.PhysicalDeviceFragmentShaderInterlockFeaturesExt, + PNext = &featuresVk12, + FragmentShaderPixelInterlock = true + }; + var enabledExtensions = _requiredExtensions.Union(_desirableExtensions.Intersect(supportedExtensions)).ToArray(); IntPtr* ppEnabledExtensions = stackalloc IntPtr[enabledExtensions.Length]; @@ -400,7 +410,7 @@ namespace Ryujinx.Graphics.Vulkan var deviceCreateInfo = new DeviceCreateInfo() { SType = StructureType.DeviceCreateInfo, - PNext = &featuresVk12, + PNext = supportedExtensions.Contains("VK_EXT_fragment_shader_interlock") ? &featuresFragmentShaderInterlock : &featuresVk12, QueueCreateInfoCount = 1, PQueueCreateInfos = &queueCreateInfo, PpEnabledExtensionNames = (byte**)ppEnabledExtensions,