aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ryujinx.Graphics.GAL/Capabilities.cs55
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/CachedGpuAccessor.cs22
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs33
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/GpuAccessorBase.cs55
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs2
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs6
-rw-r--r--Ryujinx.Graphics.OpenGL/Renderer.cs2
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs13
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs24
-rw-r--r--Ryujinx.Graphics.Shader/IGpuAccessor.cs30
-rw-r--r--Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs4
-rw-r--r--Ryujinx.Graphics.Shader/Translation/Rewriter.cs4
-rw-r--r--Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs2
13 files changed, 150 insertions, 102 deletions
diff --git a/Ryujinx.Graphics.GAL/Capabilities.cs b/Ryujinx.Graphics.GAL/Capabilities.cs
index d0c63bf2..937c3f5b 100644
--- a/Ryujinx.Graphics.GAL/Capabilities.cs
+++ b/Ryujinx.Graphics.GAL/Capabilities.cs
@@ -2,37 +2,44 @@ namespace Ryujinx.Graphics.GAL
{
public struct Capabilities
{
- public bool SupportsAstcCompression { get; }
- public bool SupportsImageLoadFormatted { get; }
- public bool SupportsMismatchingViewFormat { get; }
+ public bool HasFrontFacingBug { get; }
+ public bool HasVectorIndexingBug { get; }
+
+ public bool SupportsAstcCompression { get; }
+ public bool SupportsImageLoadFormatted { get; }
+ public bool SupportsMismatchingViewFormat { get; }
public bool SupportsNonConstantTextureOffset { get; }
- public bool SupportsTextureShadowLod { get; }
- public bool SupportsViewportSwizzle { get; }
+ public bool SupportsTextureShadowLod { get; }
+ public bool SupportsViewportSwizzle { get; }
- public int MaximumComputeSharedMemorySize { get; }
- public float MaximumSupportedAnisotropy { get; }
- public int StorageBufferOffsetAlignment { get; }
+ public int MaximumComputeSharedMemorySize { get; }
+ public float MaximumSupportedAnisotropy { get; }
+ public int StorageBufferOffsetAlignment { get; }
public Capabilities(
- bool supportsAstcCompression,
- bool supportsImageLoadFormatted,
- bool supportsMismatchingViewFormat,
- bool supportsNonConstantTextureOffset,
- bool supportsTextureShadowLod,
- bool supportsViewportSwizzle,
- int maximumComputeSharedMemorySize,
+ bool hasFrontFacingBug,
+ bool hasVectorIndexingBug,
+ bool supportsAstcCompression,
+ bool supportsImageLoadFormatted,
+ bool supportsMismatchingViewFormat,
+ bool supportsNonConstantTextureOffset,
+ bool supportsTextureShadowLod,
+ bool supportsViewportSwizzle,
+ int maximumComputeSharedMemorySize,
float maximumSupportedAnisotropy,
- int storageBufferOffsetAlignment)
+ int storageBufferOffsetAlignment)
{
- SupportsAstcCompression = supportsAstcCompression;
- SupportsImageLoadFormatted = supportsImageLoadFormatted;
- SupportsMismatchingViewFormat = supportsMismatchingViewFormat;
+ HasFrontFacingBug = hasFrontFacingBug;
+ HasVectorIndexingBug = hasVectorIndexingBug;
+ SupportsAstcCompression = supportsAstcCompression;
+ SupportsImageLoadFormatted = supportsImageLoadFormatted;
+ SupportsMismatchingViewFormat = supportsMismatchingViewFormat;
SupportsNonConstantTextureOffset = supportsNonConstantTextureOffset;
- SupportsTextureShadowLod = supportsTextureShadowLod;
- SupportsViewportSwizzle = supportsViewportSwizzle;
- MaximumComputeSharedMemorySize = maximumComputeSharedMemorySize;
- MaximumSupportedAnisotropy = maximumSupportedAnisotropy;
- StorageBufferOffsetAlignment = storageBufferOffsetAlignment;
+ SupportsTextureShadowLod = supportsTextureShadowLod;
+ SupportsViewportSwizzle = supportsViewportSwizzle;
+ MaximumComputeSharedMemorySize = maximumComputeSharedMemorySize;
+ MaximumSupportedAnisotropy = maximumSupportedAnisotropy;
+ StorageBufferOffsetAlignment = storageBufferOffsetAlignment;
}
}
} \ No newline at end of file
diff --git a/Ryujinx.Graphics.Gpu/Shader/CachedGpuAccessor.cs b/Ryujinx.Graphics.Gpu/Shader/CachedGpuAccessor.cs
index 452dfd83..625b8bac 100644
--- a/Ryujinx.Graphics.Gpu/Shader/CachedGpuAccessor.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/CachedGpuAccessor.cs
@@ -9,7 +9,6 @@ namespace Ryujinx.Graphics.Gpu.Shader
{
class CachedGpuAccessor : TextureDescriptorCapableGpuAccessor, IGpuAccessor
{
- private readonly GpuContext _context;
private readonly ReadOnlyMemory<byte> _data;
private readonly ReadOnlyMemory<byte> _cb1Data;
private readonly GuestGpuAccessorHeader _header;
@@ -28,9 +27,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
ReadOnlyMemory<byte> data,
ReadOnlyMemory<byte> cb1Data,
GuestGpuAccessorHeader header,
- Dictionary<int, GuestTextureDescriptor> guestTextureDescriptors)
+ IReadOnlyDictionary<int, GuestTextureDescriptor> guestTextureDescriptors) : base(context)
{
- _context = context;
_data = data;
_cb1Data = cb1Data;
_header = header;
@@ -137,24 +135,6 @@ namespace Ryujinx.Graphics.Gpu.Shader
}
/// <summary>
- /// Queries host storage buffer alignment required.
- /// </summary>
- /// <returns>Host storage buffer alignment in bytes</returns>
- public int QueryStorageBufferOffsetAlignment() => _context.Capabilities.StorageBufferOffsetAlignment;
-
- /// <summary>
- /// Queries host support for readable images without a explicit format declaration on the shader.
- /// </summary>
- /// <returns>True if formatted image load is supported, false otherwise</returns>
- public bool QuerySupportsImageLoadFormatted() => _context.Capabilities.SupportsImageLoadFormatted;
-
- /// <summary>
- /// Queries host GPU non-constant texture offset support.
- /// </summary>
- /// <returns>True if the GPU and driver supports non-constant texture offsets, false otherwise</returns>
- public bool QuerySupportsNonConstantTextureOffset() => _context.Capabilities.SupportsNonConstantTextureOffset;
-
- /// <summary>
/// Gets the texture descriptor for a given texture on the pool.
/// </summary>
/// <param name="handle">Index of the texture (this is the word offset of the handle in the constant buffer)</param>
diff --git a/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs b/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs
index 6254b1c2..65c8c287 100644
--- a/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs
@@ -7,9 +7,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <summary>
/// Represents a GPU state and memory accessor.
/// </summary>
- class GpuAccessor : TextureDescriptorCapableGpuAccessor, IGpuAccessor
+ class GpuAccessor : TextureDescriptorCapableGpuAccessor
{
- private readonly GpuContext _context;
private readonly GpuChannel _channel;
private readonly GpuAccessorState _state;
private readonly int _stageIndex;
@@ -29,9 +28,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <param name="channel">GPU channel</param>
/// <param name="state">Current GPU state</param>
/// <param name="stageIndex">Graphics shader stage index (0 = Vertex, 4 = Fragment)</param>
- public GpuAccessor(GpuContext context, GpuChannel channel, GpuAccessorState state, int stageIndex)
+ public GpuAccessor(GpuContext context, GpuChannel channel, GpuAccessorState state, int stageIndex) : base(context)
{
- _context = context;
_channel = channel;
_state = state;
_stageIndex = stageIndex;
@@ -56,9 +54,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
int localSizeY,
int localSizeZ,
int localMemorySize,
- int sharedMemorySize)
+ int sharedMemorySize) : base(context)
{
- _context = context;
_channel = channel;
_state = state;
_compute = true;
@@ -183,30 +180,6 @@ namespace Ryujinx.Graphics.Gpu.Shader
}
/// <summary>
- /// Queries host storage buffer alignment required.
- /// </summary>
- /// <returns>Host storage buffer alignment in bytes</returns>
- public int QueryStorageBufferOffsetAlignment() => _context.Capabilities.StorageBufferOffsetAlignment;
-
- /// <summary>
- /// Queries host support for readable images without a explicit format declaration on the shader.
- /// </summary>
- /// <returns>True if formatted image load is supported, false otherwise</returns>
- public bool QuerySupportsImageLoadFormatted() => _context.Capabilities.SupportsImageLoadFormatted;
-
- /// <summary>
- /// Queries host GPU non-constant texture offset support.
- /// </summary>
- /// <returns>True if the GPU and driver supports non-constant texture offsets, false otherwise</returns>
- public bool QuerySupportsNonConstantTextureOffset() => _context.Capabilities.SupportsNonConstantTextureOffset;
-
- /// <summary>
- /// Queries host GPU texture shadow LOD support.
- /// </summary>
- /// <returns>True if the GPU and driver supports texture shadow LOD, false otherwise</returns>
- public bool QuerySupportsTextureShadowLod() => _context.Capabilities.SupportsTextureShadowLod;
-
- /// <summary>
/// Gets the texture descriptor for a given texture on the pool.
/// </summary>
/// <param name="handle">Index of the texture (this is the word offset of the handle in the constant buffer)</param>
diff --git a/Ryujinx.Graphics.Gpu/Shader/GpuAccessorBase.cs b/Ryujinx.Graphics.Gpu/Shader/GpuAccessorBase.cs
new file mode 100644
index 00000000..fb990cfe
--- /dev/null
+++ b/Ryujinx.Graphics.Gpu/Shader/GpuAccessorBase.cs
@@ -0,0 +1,55 @@
+namespace Ryujinx.Graphics.Gpu.Shader
+{
+ /// <summary>
+ /// Represents a GPU state and memory accessor.
+ /// </summary>
+ class GpuAccessorBase
+ {
+ private readonly GpuContext _context;
+
+ /// <summary>
+ /// Creates a new instance of the GPU state accessor.
+ /// </summary>
+ /// <param name="context">GPU context</param>
+ public GpuAccessorBase(GpuContext context)
+ {
+ _context = context;
+ }
+
+ /// <summary>
+ /// Queries host about the presence of the FrontFacing built-in variable bug.
+ /// </summary>
+ /// <returns>True if the bug is present on the host device used, false otherwise</returns>
+ public bool QueryHostHasFrontFacingBug() => _context.Capabilities.HasFrontFacingBug;
+
+ /// <summary>
+ /// Queries host about the presence of the vector indexing bug.
+ /// </summary>
+ /// <returns>True if the bug is present on the host device used, false otherwise</returns>
+ public bool QueryHostHasVectorIndexingBug() => _context.Capabilities.HasVectorIndexingBug;
+
+ /// <summary>
+ /// Queries host storage buffer alignment required.
+ /// </summary>
+ /// <returns>Host storage buffer alignment in bytes</returns>
+ public int QueryHostStorageBufferOffsetAlignment() => _context.Capabilities.StorageBufferOffsetAlignment;
+
+ /// <summary>
+ /// Queries host support for readable images without a explicit format declaration on the shader.
+ /// </summary>
+ /// <returns>True if formatted image load is supported, false otherwise</returns>
+ public bool QueryHostSupportsImageLoadFormatted() => _context.Capabilities.SupportsImageLoadFormatted;
+
+ /// <summary>
+ /// Queries host GPU non-constant texture offset support.
+ /// </summary>
+ /// <returns>True if the GPU and driver supports non-constant texture offsets, false otherwise</returns>
+ public bool QueryHostSupportsNonConstantTextureOffset() => _context.Capabilities.SupportsNonConstantTextureOffset;
+
+ /// <summary>
+ /// Queries host GPU texture shadow LOD support.
+ /// </summary>
+ /// <returns>True if the GPU and driver supports texture shadow LOD, false otherwise</returns>
+ public bool QueryHostSupportsTextureShadowLod() => _context.Capabilities.SupportsTextureShadowLod;
+ }
+}
diff --git a/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs b/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs
index 2c1fb084..fada667c 100644
--- a/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs
@@ -38,7 +38,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <summary>
/// Version of the codegen (to be changed when codegen or guest format change).
/// </summary>
- private const ulong ShaderCodeGenVersion = 2538;
+ private const ulong ShaderCodeGenVersion = 2540;
// Progress reporting helpers
private volatile int _shaderCount;
diff --git a/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs b/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs
index 904a0fd4..35507449 100644
--- a/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs
@@ -4,8 +4,12 @@ using Ryujinx.Graphics.Shader;
namespace Ryujinx.Graphics.Gpu.Shader
{
- abstract class TextureDescriptorCapableGpuAccessor : IGpuAccessor
+ abstract class TextureDescriptorCapableGpuAccessor : GpuAccessorBase, IGpuAccessor
{
+ public TextureDescriptorCapableGpuAccessor(GpuContext context) : base(context)
+ {
+ }
+
public abstract T MemoryRead<T>(ulong address) where T : unmanaged;
public abstract ITextureDescriptor GetTextureDescriptor(int handle, int cbufSlot);
diff --git a/Ryujinx.Graphics.OpenGL/Renderer.cs b/Ryujinx.Graphics.OpenGL/Renderer.cs
index c7749228..22648fd1 100644
--- a/Ryujinx.Graphics.OpenGL/Renderer.cs
+++ b/Ryujinx.Graphics.OpenGL/Renderer.cs
@@ -99,6 +99,8 @@ namespace Ryujinx.Graphics.OpenGL
public Capabilities GetCapabilities()
{
return new Capabilities(
+ HwCapabilities.Vendor == HwCapabilities.GpuVendor.IntelWindows,
+ HwCapabilities.Vendor == HwCapabilities.GpuVendor.AmdWindows,
HwCapabilities.SupportsAstcCompression,
HwCapabilities.SupportsImageLoadFormatted,
HwCapabilities.SupportsMismatchingViewFormat,
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs
index f6aab74d..ef3b0bed 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs
@@ -157,15 +157,18 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
offsetExpr = Enclose(offsetExpr, src2, Instruction.ShiftRightS32, isLhs: true);
+ var config = context.Config;
+ bool indexElement = !config.GpuAccessor.QueryHostHasVectorIndexingBug();
+
if (src1 is AstOperand oper && oper.Type == OperandType.Constant)
{
- bool cbIndexable = context.Config.UsedFeatures.HasFlag(Translation.FeatureFlags.CbIndexing);
- return OperandManager.GetConstantBufferName(oper.Value, offsetExpr, context.Config.Stage, cbIndexable);
+ bool cbIndexable = config.UsedFeatures.HasFlag(Translation.FeatureFlags.CbIndexing);
+ return OperandManager.GetConstantBufferName(oper.Value, offsetExpr, config.Stage, cbIndexable, indexElement);
}
else
{
string slotExpr = GetSoureExpr(context, src1, GetSrcVarType(operation.Inst, 0));
- return OperandManager.GetConstantBufferName(slotExpr, offsetExpr, context.Config.Stage);
+ return OperandManager.GetConstantBufferName(slotExpr, offsetExpr, config.Stage, indexElement);
}
}
@@ -314,7 +317,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
// 2D Array and Cube shadow samplers with LOD level or bias requires an extension.
// If the extension is not supported, just remove the LOD parameter.
- if (isArray && isShadow && (is2D || isCube) && !context.Config.GpuAccessor.QuerySupportsTextureShadowLod())
+ if (isArray && isShadow && (is2D || isCube) && !context.Config.GpuAccessor.QueryHostSupportsTextureShadowLod())
{
hasLodBias = false;
hasLodLevel = false;
@@ -322,7 +325,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
// Cube shadow samplers with LOD level requires an extension.
// If the extension is not supported, just remove the LOD level parameter.
- if (isShadow && isCube && !context.Config.GpuAccessor.QuerySupportsTextureShadowLod())
+ if (isShadow && isCube && !context.Config.GpuAccessor.QueryHostSupportsTextureShadowLod())
{
hasLodLevel = false;
}
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
index 03fbb8a4..60a471eb 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
@@ -117,8 +117,13 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
return $"{GetUbName(stage, slot, cbIndexable)}[{offset >> 2}].{GetSwizzleMask(offset & 3)}";
}
- private static string GetVec4Indexed(string vectorName, string indexExpr)
+ private static string GetVec4Indexed(string vectorName, string indexExpr, bool indexElement)
{
+ if (indexElement)
+ {
+ return $"{vectorName}[{indexExpr}]";
+ }
+
string result = $"{vectorName}.x";
for (int i = 1; i < 4; i++)
{
@@ -127,14 +132,14 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
return $"({result})";
}
- public static string GetConstantBufferName(int slot, string offsetExpr, ShaderStage stage, bool cbIndexable)
+ public static string GetConstantBufferName(int slot, string offsetExpr, ShaderStage stage, bool cbIndexable, bool indexElement)
{
- return GetVec4Indexed(GetUbName(stage, slot, cbIndexable) + $"[{offsetExpr} >> 2]", offsetExpr + " & 3");
+ return GetVec4Indexed(GetUbName(stage, slot, cbIndexable) + $"[{offsetExpr} >> 2]", offsetExpr + " & 3", indexElement);
}
- public static string GetConstantBufferName(string slotExpr, string offsetExpr, ShaderStage stage)
+ public static string GetConstantBufferName(string slotExpr, string offsetExpr, ShaderStage stage, bool indexElement)
{
- return GetVec4Indexed(GetUbName(stage, slotExpr) + $"[{offsetExpr} >> 2]", offsetExpr + " & 3");
+ return GetVec4Indexed(GetUbName(stage, slotExpr) + $"[{offsetExpr} >> 2]", offsetExpr + " & 3", indexElement);
}
public static string GetOutAttributeName(AstOperand attr, ShaderConfig config)
@@ -198,6 +203,15 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
case AttributeConsts.PositionY: return $"(gl_FragCoord.y / {DefaultNames.SupportBlockRenderScaleName}[0])";
case AttributeConsts.PositionZ: return "gl_FragCoord.z";
case AttributeConsts.PositionW: return "gl_FragCoord.w";
+
+ case AttributeConsts.FrontFacing:
+ if (config.GpuAccessor.QueryHostHasFrontFacingBug())
+ {
+ // This is required for Intel on Windows, gl_FrontFacing sometimes returns incorrect
+ // (flipped) values. Doing this seems to fix it.
+ return "(-floatBitsToInt(float(gl_FrontFacing)) < 0)";
+ }
+ break;
}
}
diff --git a/Ryujinx.Graphics.Shader/IGpuAccessor.cs b/Ryujinx.Graphics.Shader/IGpuAccessor.cs
index 04f23061..84c30479 100644
--- a/Ryujinx.Graphics.Shader/IGpuAccessor.cs
+++ b/Ryujinx.Graphics.Shader/IGpuAccessor.cs
@@ -49,39 +49,49 @@
return 0;
}
- bool QueryIsTextureBuffer(int handle, int cbufSlot = -1)
+ bool QueryHostHasFrontFacingBug()
{
return false;
}
- bool QueryIsTextureRectangle(int handle, int cbufSlot = -1)
+ bool QueryHostHasVectorIndexingBug()
{
return false;
}
- InputTopology QueryPrimitiveTopology()
+ int QueryHostStorageBufferOffsetAlignment()
{
- return InputTopology.Points;
+ return 16;
}
- int QueryStorageBufferOffsetAlignment()
+ bool QueryHostSupportsImageLoadFormatted()
{
- return 16;
+ return true;
}
- bool QuerySupportsImageLoadFormatted()
+ bool QueryHostSupportsNonConstantTextureOffset()
{
return true;
}
- bool QuerySupportsNonConstantTextureOffset()
+ bool QueryHostSupportsTextureShadowLod()
{
return true;
}
- bool QuerySupportsTextureShadowLod()
+ bool QueryIsTextureBuffer(int handle, int cbufSlot = -1)
{
- return true;
+ return false;
+ }
+
+ bool QueryIsTextureRectangle(int handle, int cbufSlot = -1)
+ {
+ return false;
+ }
+
+ InputTopology QueryPrimitiveTopology()
+ {
+ return InputTopology.Points;
}
TextureFormat QueryTextureFormat(int handle, int cbufSlot = -1)
diff --git a/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs b/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
index bccb0cbe..cc57102c 100644
--- a/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
+++ b/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
@@ -71,7 +71,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
Operand baseAddrTrunc = Local();
- Operand alignMask = Const(-config.GpuAccessor.QueryStorageBufferOffsetAlignment());
+ Operand alignMask = Const(-config.GpuAccessor.QueryHostStorageBufferOffsetAlignment());
Operation andOp = new Operation(Instruction.BitwiseAnd, baseAddrTrunc, baseAddrLow, alignMask);
@@ -142,7 +142,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
Operand baseAddrTrunc = Local();
- Operand alignMask = Const(-config.GpuAccessor.QueryStorageBufferOffsetAlignment());
+ Operand alignMask = Const(-config.GpuAccessor.QueryHostStorageBufferOffsetAlignment());
Operation andOp = new Operation(Instruction.BitwiseAnd, baseAddrTrunc, baseAddrLow, alignMask);
diff --git a/Ryujinx.Graphics.Shader/Translation/Rewriter.cs b/Ryujinx.Graphics.Shader/Translation/Rewriter.cs
index fba586c8..47428520 100644
--- a/Ryujinx.Graphics.Shader/Translation/Rewriter.cs
+++ b/Ryujinx.Graphics.Shader/Translation/Rewriter.cs
@@ -93,7 +93,7 @@ namespace Ryujinx.Graphics.Shader.Translation
sbSlot = PrependOperation(Instruction.ConditionalSelect, inRange, Const(slot), sbSlot);
}
- Operand alignMask = Const(-config.GpuAccessor.QueryStorageBufferOffsetAlignment());
+ Operand alignMask = Const(-config.GpuAccessor.QueryHostStorageBufferOffsetAlignment());
Operand baseAddrTrunc = PrependOperation(Instruction.BitwiseAnd, sbBaseAddrLow, alignMask);
Operand byteOffset = PrependOperation(Instruction.Subtract, addrLow, baseAddrTrunc);
@@ -145,7 +145,7 @@ namespace Ryujinx.Graphics.Shader.Translation
bool hasOffset = (texOp.Flags & TextureFlags.Offset) != 0;
bool hasOffsets = (texOp.Flags & TextureFlags.Offsets) != 0;
- bool hasInvalidOffset = (hasOffset || hasOffsets) && !config.GpuAccessor.QuerySupportsNonConstantTextureOffset();
+ bool hasInvalidOffset = (hasOffset || hasOffsets) && !config.GpuAccessor.QueryHostSupportsNonConstantTextureOffset();
bool isBindless = (texOp.Flags & TextureFlags.Bindless) != 0;
diff --git a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
index c7704c2b..02e995f9 100644
--- a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
+++ b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
@@ -145,7 +145,7 @@ namespace Ryujinx.Graphics.Shader.Translation
{
// When the formatted load extension is supported, we don't need to
// specify a format, we can just declare it without a format and the GPU will handle it.
- if (GpuAccessor.QuerySupportsImageLoadFormatted())
+ if (GpuAccessor.QueryHostSupportsImageLoadFormatted())
{
return TextureFormat.Unknown;
}