Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/auto-load-e…
Browse files Browse the repository at this point in the history
…xtra-files
  • Loading branch information
J-Swift committed Aug 24, 2024
2 parents bb24688 + b45a814 commit b3f3b19
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="Concentus" Version="2.2.0" />
<PackageVersion Include="DiscordRichPresence" Version="1.2.1.24" />
<PackageVersion Include="DynamicData" Version="9.0.1" />
<PackageVersion Include="DynamicData" Version="9.0.4" />
<PackageVersion Include="FluentAvaloniaUI" Version="2.0.5" />
<PackageVersion Include="GtkSharp.Dependencies" Version="1.1.1" />
<PackageVersion Include="GtkSharp.Dependencies.osx" Version="0.0.5" />
Expand Down Expand Up @@ -42,7 +42,7 @@
<PackageVersion Include="Silk.NET.Vulkan" Version="2.16.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.8" />
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.9" />
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="1.0.0" />
<PackageVersion Include="SPB" Version="0.0.4-build32" />
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
Expand Down
27 changes: 18 additions & 9 deletions src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public bool TexturePoolModified()
/// <returns>True if any used entries of the pool might have been modified, false otherwise</returns>
public bool SamplerPoolModified()
{
return SamplerPool.WasModified(ref _samplerPoolSequence);
return SamplerPool != null && SamplerPool.WasModified(ref _samplerPoolSequence);
}
}

Expand Down Expand Up @@ -516,12 +516,15 @@ public bool PoolsModified()
}

// Check if any of our cached samplers changed on the pool.
foreach ((int samplerId, (Sampler sampler, SamplerDescriptor descriptor)) in SamplerIds)
if (SamplerPool != null)
{
if (SamplerPool.GetCachedItem(samplerId) != sampler ||
(sampler == null && SamplerPool.IsValidId(samplerId) && !SamplerPool.GetDescriptorRef(samplerId).Equals(descriptor)))
foreach ((int samplerId, (Sampler sampler, SamplerDescriptor descriptor)) in SamplerIds)
{
return true;
if (SamplerPool.GetCachedItem(samplerId) != sampler ||
(sampler == null && SamplerPool.IsValidId(samplerId) && !SamplerPool.GetDescriptorRef(samplerId).Equals(descriptor)))
{
return true;
}
}
}

Expand Down Expand Up @@ -899,13 +902,19 @@ private void UpdateFromBuffer(
}
}

Sampler sampler = samplerPool?.Get(samplerId);

entry.TextureIds[textureId] = (texture, descriptor);
entry.SamplerIds[samplerId] = (sampler, samplerPool?.GetDescriptorRef(samplerId) ?? default);

ITexture hostTexture = texture?.GetTargetTexture(bindingInfo.Target);
ISampler hostSampler = sampler?.GetHostSampler(texture);
ISampler hostSampler = null;

if (!isImage && bindingInfo.Target != Target.TextureBuffer)
{
Sampler sampler = samplerPool?.Get(samplerId);

entry.SamplerIds[samplerId] = (sampler, samplerPool?.GetDescriptorRef(samplerId) ?? default);

hostSampler = sampler?.GetHostSampler(texture);
}

Format format = bindingInfo.Format;

Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Graphics.Vulkan/ImageArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void SetDirty()
{
_cachedCommandBufferIndex = -1;
_storages = null;
SetDirty(_gd);
SetDirty(_gd, isImage: true);
}

public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags)
Expand Down
11 changes: 9 additions & 2 deletions src/Ryujinx.Graphics.Vulkan/ResourceArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@ class ResourceArray : IDisposable

private int _bindCount;

protected void SetDirty(VulkanRenderer gd)
protected void SetDirty(VulkanRenderer gd, bool isImage)
{
ReleaseDescriptorSet();

if (_bindCount != 0)
{
gd.PipelineInternal.ForceTextureDirty();
if (isImage)
{
gd.PipelineInternal.ForceImageDirty();
}
else
{
gd.PipelineInternal.ForceTextureDirty();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Graphics.Vulkan/TextureArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void SetDirty()
{
_cachedCommandBufferIndex = -1;
_storages = null;
SetDirty(_gd);
SetDirty(_gd, isImage: false);
}

public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags)
Expand Down

0 comments on commit b3f3b19

Please sign in to comment.