From 3148c0c21cb45a92ff77344027757fb4808bb3cb Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 11 Aug 2021 18:56:59 -0300 Subject: Unify GpuAccessorBase and TextureDescriptorCapableGpuAccessor (#2542) * Unify GpuAccessorBase and TextureDescriptorCapableGpuAccessor * Shader cache version bump --- .../Shader/TextureDescriptorCapableGpuAccessor.cs | 43 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs') diff --git a/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs b/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs index 35507449..54b4133a 100644 --- a/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs +++ b/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs @@ -4,16 +4,55 @@ using Ryujinx.Graphics.Shader; namespace Ryujinx.Graphics.Gpu.Shader { - abstract class TextureDescriptorCapableGpuAccessor : GpuAccessorBase, IGpuAccessor + abstract class TextureDescriptorCapableGpuAccessor : IGpuAccessor { - public TextureDescriptorCapableGpuAccessor(GpuContext context) : base(context) + private readonly GpuContext _context; + + public TextureDescriptorCapableGpuAccessor(GpuContext context) { + _context = context; } public abstract T MemoryRead(ulong address) where T : unmanaged; public abstract ITextureDescriptor GetTextureDescriptor(int handle, int cbufSlot); + /// + /// Queries host about the presence of the FrontFacing built-in variable bug. + /// + /// True if the bug is present on the host device used, false otherwise + public bool QueryHostHasFrontFacingBug() => _context.Capabilities.HasFrontFacingBug; + + /// + /// Queries host about the presence of the vector indexing bug. + /// + /// True if the bug is present on the host device used, false otherwise + public bool QueryHostHasVectorIndexingBug() => _context.Capabilities.HasVectorIndexingBug; + + /// + /// Queries host storage buffer alignment required. + /// + /// Host storage buffer alignment in bytes + public int QueryHostStorageBufferOffsetAlignment() => _context.Capabilities.StorageBufferOffsetAlignment; + + /// + /// Queries host support for readable images without a explicit format declaration on the shader. + /// + /// True if formatted image load is supported, false otherwise + public bool QueryHostSupportsImageLoadFormatted() => _context.Capabilities.SupportsImageLoadFormatted; + + /// + /// Queries host GPU non-constant texture offset support. + /// + /// True if the GPU and driver supports non-constant texture offsets, false otherwise + public bool QueryHostSupportsNonConstantTextureOffset() => _context.Capabilities.SupportsNonConstantTextureOffset; + + /// + /// Queries host GPU texture shadow LOD support. + /// + /// True if the GPU and driver supports texture shadow LOD, false otherwise + public bool QueryHostSupportsTextureShadowLod() => _context.Capabilities.SupportsTextureShadowLod; + /// /// Queries texture format information, for shaders using image load or store. /// -- cgit v1.2.3