forked from MeloNX/MeloNX
Add work around for Adreno batched texture + sampler descriptor updates bug
(cherry picked from commit 93abc5ac47fedc413a3437c65de9fecf0555afa6)
This commit is contained in:
parent
32064ccba5
commit
88c45e1e86
34
src/Ryujinx.Graphics.Gpu/Memory/VirtualBufferBounds.cs
Normal file
34
src/Ryujinx.Graphics.Gpu/Memory/VirtualBufferBounds.cs
Normal file
@ -0,0 +1,34 @@
|
||||
namespace Ryujinx.Graphics.Gpu.Memory
|
||||
{
|
||||
/// <summary>
|
||||
/// Virtual memory range used for buffers.
|
||||
/// </summary>
|
||||
readonly struct VirtualBufferBounds
|
||||
{
|
||||
/// <summary>
|
||||
/// Base virtual address.
|
||||
/// </summary>
|
||||
public ulong GpuVa { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Binding size.
|
||||
/// </summary>
|
||||
public ulong Size { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new virtual buffer region.
|
||||
/// </summary>
|
||||
/// <param name="gpuVa">Base virtual address</param>
|
||||
/// <param name="size">Binding size</param>
|
||||
public VirtualBufferBounds(ulong gpuVa, ulong size)
|
||||
{
|
||||
GpuVa = gpuVa;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
public bool Equals(ulong gpuVa, ulong size)
|
||||
{
|
||||
return GpuVa == gpuVa && Size == size;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Silk.NET.Vulkan;
|
||||
using System;
|
||||
@ -130,9 +130,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
UsePushDescriptors = usePushDescriptors;
|
||||
|
||||
Stages = stages;
|
||||
bool hasBatchedTextureSamplerBug = false;//gd.Vendor == Vendor.Qualcomm;
|
||||
|
||||
ClearSegments = BuildClearSegments(sets);
|
||||
BindingSegments = BuildBindingSegments(resourceLayout.SetUsages, out bool usesBufferTextures);
|
||||
BindingSegments = BuildBindingSegments(resourceLayout.SetUsages, hasBatchedTextureSamplerBug, out bool usesBufferTextures);
|
||||
Templates = BuildTemplates(usePushDescriptors);
|
||||
(IncoherentBufferWriteStages, IncoherentTextureWriteStages) = BuildIncoherentStages(resourceLayout.SetUsages);
|
||||
|
||||
@ -289,7 +290,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
return segments;
|
||||
}
|
||||
|
||||
private static ResourceBindingSegment[][] BuildBindingSegments(ReadOnlyCollection<ResourceUsageCollection> setUsages, out bool usesBufferTextures)
|
||||
private static ResourceBindingSegment[][] BuildBindingSegments(ReadOnlyCollection<ResourceUsageCollection> setUsages, bool hasBatchedTextureSamplerBug, out bool usesBufferTextures)
|
||||
{
|
||||
usesBufferTextures = false;
|
||||
|
||||
@ -313,6 +314,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
if (currentUsage.Binding + currentCount != usage.Binding ||
|
||||
currentUsage.Type != usage.Type ||
|
||||
(currentUsage.Type == ResourceType.TextureAndSampler && hasBatchedTextureSamplerBug) ||
|
||||
currentUsage.Stages != usage.Stages ||
|
||||
currentUsage.ArrayLength > 1 ||
|
||||
usage.ArrayLength > 1)
|
||||
|
Reference in New Issue
Block a user