Fix oversight packing/unpacking

This commit is contained in:
sunshineinabox 2023-08-15 13:38:45 -07:00
parent 68378caa69
commit 33ce657f80
3 changed files with 3 additions and 3 deletions

View file

@ -381,7 +381,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
IProgram hostProgram;
if (context.Capabilities.Api == TargetApi.Vulkan)
if (context.Capabilities.Api == TargetApi.Vulkan || GraphicsConfig.EnableOGLSpirV)
{
ShaderSource[] shaderSources = ShaderBinarySerializer.Unpack(shaders, hostCode);

View file

@ -504,7 +504,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
CachedShaderProgram program = new(hostProgram, compilation.SpecializationState, compilation.Shaders);
// Vulkan's binary code is the SPIR-V used for compilation, so it is ready immediately. Other APIs get this after compilation.
byte[] binaryCode = _context.Capabilities.Api == TargetApi.Vulkan ? ShaderBinarySerializer.Pack(shaderSources) : null;
byte[] binaryCode = (_context.Capabilities.Api == TargetApi.Vulkan || GraphicsConfig.EnableOGLSpirV) ? ShaderBinarySerializer.Pack(shaderSources) : null;
EnqueueForValidation(new ProgramEntry(program, binaryCode, compilation.ProgramIndex, compilation.IsCompute, isBinary: false));
}

View file

@ -490,7 +490,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
{
if (_diskCacheHostStorage.CacheEnabled)
{
byte[] binaryCode = _context.Capabilities.Api == TargetApi.Vulkan ? ShaderBinarySerializer.Pack(sources) : null;
byte[] binaryCode = (_context.Capabilities.Api == TargetApi.Vulkan || GraphicsConfig.EnableOGLSpirV) ? ShaderBinarySerializer.Pack(sources) : null;
ProgramToSave programToSave = new(program, hostProgram, binaryCode);
_programsToSaveQueue.Enqueue(programToSave);