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

@ -368,12 +368,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
if (hostCode != null)
{
bool hasFragmentShader = shaders.Length > 5 && shaders[5] != null;
int fragmentOutputMap = hasFragmentShader ? shaders[5].Info.FragmentOutputMap : -1;
ShaderInfo shaderInfo = specState.PipelineState.HasValue
? new ShaderInfo(fragmentOutputMap, specState.PipelineState.Value, fromCache: true)
: new ShaderInfo(fragmentOutputMap, fromCache: true);
ShaderInfo shaderInfo = ShaderInfoBuilder.BuildForCache(context, shaders, specState.PipelineState);
IProgram hostProgram;
@ -385,6 +380,8 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
}
else
{
bool hasFragmentShader = shaders.Length > 5 && shaders[5] != null;
hostProgram = context.Renderer.LoadProgramBinary(hostCode, hasFragmentShader, shaderInfo);
}