Replace ShaderBindings with new ResourceLayout structure for Vulkan (#5025)

* Introduce ResourceLayout

* Part 1: Use new ResourceSegments array on UpdateAndBind

* Part 2: Use ResourceLayout to build PipelineLayout

* Delete old code

* XML docs

* Fix shader cache load NRE

* Fix typo
This commit is contained in:
gdkchan 2023-05-21 14:04:21 -03:00 committed by GitHub
parent 402f05b8ef
commit 5626f2ca1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 1047 additions and 677 deletions

View file

@ -10,7 +10,6 @@ using Silk.NET.Vulkan.Extensions.EXT;
using Silk.NET.Vulkan.Extensions.KHR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.Vulkan
@ -398,17 +397,17 @@ namespace Ryujinx.Graphics.Vulkan
if (info.State.HasValue || isCompute)
{
return new ShaderCollection(this, _device, sources, info.State ?? default, info.FromCache);
return new ShaderCollection(this, _device, sources, info.ResourceLayout, info.State ?? default, info.FromCache);
}
else
{
return new ShaderCollection(this, _device, sources);
return new ShaderCollection(this, _device, sources, info.ResourceLayout);
}
}
internal ShaderCollection CreateProgramWithMinimalLayout(ShaderSource[] sources, SpecDescription[] specDescription = null)
internal ShaderCollection CreateProgramWithMinimalLayout(ShaderSource[] sources, ResourceLayout resourceLayout, SpecDescription[] specDescription = null)
{
return new ShaderCollection(this, _device, sources, specDescription: specDescription, isMinimal: true);
return new ShaderCollection(this, _device, sources, resourceLayout, specDescription, isMinimal: true);
}
public ISampler CreateSampler(GAL.SamplerCreateInfo info)
@ -658,7 +657,7 @@ namespace Ryujinx.Graphics.Vulkan
Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
}
public GAL.PrimitiveTopology TopologyRemap(GAL.PrimitiveTopology topology)
internal GAL.PrimitiveTopology TopologyRemap(GAL.PrimitiveTopology topology)
{
return topology switch
{
@ -669,7 +668,7 @@ namespace Ryujinx.Graphics.Vulkan
};
}
public bool TopologyUnsupported(GAL.PrimitiveTopology topology)
internal bool TopologyUnsupported(GAL.PrimitiveTopology topology)
{
return topology switch
{