misc: chore: Use explicit types in GPU, Device, and Host1x projects

This commit is contained in:
Evan Husted
2025-01-25 14:05:44 -06:00
parent 5099548856
commit 1ae349efb1
55 changed files with 350 additions and 339 deletions

View File

@@ -221,7 +221,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
sb.AppendLine($"private static Dictionary<Hash128, AdvancedBlendEntry> _entries = new()");
sb.AppendLine("{");
foreach (var entry in Table)
foreach (AdvancedBlendUcode entry in Table)
{
Hash128 hash = Hash128.ComputeHash(MemoryMarshal.Cast<uint, byte>(entry.Code));

View File

@@ -66,7 +66,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
descriptor = default;
if (!AdvancedBlendPreGenTable.Entries.TryGetValue(hash, out var entry))
if (!AdvancedBlendPreGenTable.Entries.TryGetValue(hash, out AdvancedBlendEntry entry))
{
return false;
}

View File

@@ -65,7 +65,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
{
if (disposing)
{
foreach (var texture in _cache.Values)
foreach (ITexture texture in _cache.Values)
{
texture.Release();
}
@@ -603,7 +603,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
DestroyIfNotNull(ref _geometryIndexDataBuffer.Handle);
DestroyIfNotNull(ref _sequentialIndexBuffer);
foreach (var indexBuffer in _topologyRemapBuffers.Values)
foreach (IndexBuffer indexBuffer in _topologyRemapBuffers.Values)
{
_context.Renderer.DeleteBuffer(indexBuffer.Handle);
}

View File

@@ -127,7 +127,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
for (int index = 0; index < Constants.TotalVertexAttribs; index++)
{
var vertexAttrib = _state.State.VertexAttribState[index];
VertexAttribState vertexAttrib = _state.State.VertexAttribState[index];
if (!FormatTable.TryGetSingleComponentAttribFormat(vertexAttrib.UnpackFormat(), out Format format, out int componentsCount))
{
@@ -153,7 +153,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
int bufferIndex = vertexAttrib.UnpackBufferIndex();
GpuVa endAddress = _state.State.VertexBufferEndAddress[bufferIndex];
var vertexBuffer = _state.State.VertexBufferState[bufferIndex];
VertexBufferState vertexBuffer = _state.State.VertexBufferState[bufferIndex];
bool instanced = _state.State.VertexBufferInstanced[bufferIndex];
ulong address = vertexBuffer.Address.Pack();
@@ -351,7 +351,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
/// <param name="size">Size of the buffer in bytes</param>
private readonly void SetBufferTexture(ResourceReservations reservations, int index, Format format, ulong address, ulong size)
{
var memoryManager = _channel.MemoryManager;
MemoryManager memoryManager = _channel.MemoryManager;
BufferRange range = memoryManager.Physical.BufferCache.GetBufferRange(memoryManager.GetPhysicalRegions(address, size), BufferStage.VertexBuffer);
@@ -392,7 +392,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
indexOffset <<= shift;
size <<= shift;
var memoryManager = _channel.MemoryManager;
MemoryManager memoryManager = _channel.MemoryManager;
ulong misalign = address & ((ulong)_context.Capabilities.TextureBufferOffsetAlignment - 1);
BufferRange range = memoryManager.Physical.BufferCache.GetBufferRange(

View File

@@ -1,3 +1,4 @@
using Ryujinx.Graphics.Gpu.Memory;
using System;
using System.Runtime.InteropServices;
@@ -92,7 +93,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (enable)
{
var uniformBuffer = _state.State.UniformBufferState;
UniformBufferState uniformBuffer = _state.State.UniformBufferState;
ulong address = uniformBuffer.Address.Pack();
@@ -111,7 +112,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
{
if (_ubFollowUpAddress != 0)
{
var memoryManager = _channel.MemoryManager;
MemoryManager memoryManager = _channel.MemoryManager;
Span<byte> data = MemoryMarshal.Cast<int, byte>(_ubData.AsSpan(0, (int)(_ubByteCount / 4)));
@@ -131,7 +132,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="argument">New uniform buffer data word</param>
public void Update(int argument)
{
var uniformBuffer = _state.State.UniformBufferState;
UniformBufferState uniformBuffer = _state.State.UniformBufferState;
ulong address = uniformBuffer.Address.Pack() + (uint)uniformBuffer.Offset;
@@ -157,7 +158,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="data">Data to be written to the uniform buffer</param>
public void Update(ReadOnlySpan<int> data)
{
var uniformBuffer = _state.State.UniformBufferState;
UniformBufferState uniformBuffer = _state.State.UniformBufferState;
ulong address = uniformBuffer.Address.Pack() + (uint)uniformBuffer.Offset;

View File

@@ -471,7 +471,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
int textureId = _state.State.DrawTextureTextureId;
int samplerId = _state.State.DrawTextureSamplerId;
(var texture, var sampler) = _channel.TextureManager.GetGraphicsTextureAndSampler(textureId, samplerId);
(Image.Texture texture, Sampler sampler) = _channel.TextureManager.GetGraphicsTextureAndSampler(textureId, samplerId);
srcX0 *= texture.ScaleFactor;
srcY0 *= texture.ScaleFactor;
@@ -684,8 +684,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (hasCount)
{
var indirectBuffer = memory.BufferCache.GetBufferRange(indirectBufferRange, BufferStage.Indirect);
var parameterBuffer = memory.BufferCache.GetBufferRange(parameterBufferRange, BufferStage.Indirect);
BufferRange indirectBuffer = memory.BufferCache.GetBufferRange(indirectBufferRange, BufferStage.Indirect);
BufferRange parameterBuffer = memory.BufferCache.GetBufferRange(parameterBufferRange, BufferStage.Indirect);
if (indexed)
{
@@ -698,7 +698,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
}
else
{
var indirectBuffer = memory.BufferCache.GetBufferRange(indirectBufferRange, BufferStage.Indirect);
BufferRange indirectBuffer = memory.BufferCache.GetBufferRange(indirectBufferRange, BufferStage.Indirect);
if (indexed)
{
@@ -820,7 +820,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
// If there is a mismatch on the host clip region and the one explicitly defined by the guest
// on the screen scissor state, then we need to force only one texture to be bound to avoid
// host clipping.
var screenScissorState = _state.State.ScreenScissorState;
ScreenScissorState screenScissorState = _state.State.ScreenScissorState;
bool clearAffectedByStencilMask = (_state.State.ClearFlags & 1) != 0;
bool clearAffectedByScissor = (_state.State.ClearFlags & 0x100) != 0;
@@ -833,7 +833,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (fullClear && clearAffectedByScissor && _state.State.ScissorState[0].Enable)
{
ref var scissorState = ref _state.State.ScissorState[0];
ref ScissorState scissorState = ref _state.State.ScissorState[0];
fullClear = scissorState.X1 == screenScissorState.X &&
scissorState.Y1 == screenScissorState.Y &&
@@ -894,7 +894,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (clearAffectedByScissor && _state.State.ScissorState[0].Enable)
{
ref var scissorState = ref _state.State.ScissorState[0];
ref ScissorState scissorState = ref _state.State.ScissorState[0];
scissorX = Math.Max(scissorX, scissorState.X1);
scissorY = Math.Max(scissorY, scissorState.Y1);
@@ -923,7 +923,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (componentMask != 0)
{
var clearColor = _state.State.ClearColors;
ClearColors clearColor = _state.State.ClearColors;
ColorF color = new(clearColor.Red, clearColor.Green, clearColor.Blue, clearColor.Alpha);

View File

@@ -288,7 +288,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
{
int rtIndex = rtControl.UnpackPermutationIndex(index);
var colorState = state[rtIndex];
RtColorState colorState = state[rtIndex];
if (index < count && StateUpdater.IsRtEnabled(colorState))
{

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -58,13 +59,13 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
_registerToGroupMapping = new byte[BlockSize];
_callbacks = new Action[entries.Length];
var fieldToDelegate = new Dictionary<string, int>();
Dictionary<string, int> fieldToDelegate = new Dictionary<string, int>();
for (int entryIndex = 0; entryIndex < entries.Length; entryIndex++)
{
var entry = entries[entryIndex];
StateUpdateCallbackEntry entry = entries[entryIndex];
foreach (var fieldName in entry.FieldNames)
foreach (string fieldName in entry.FieldNames)
{
fieldToDelegate.Add(fieldName, entryIndex);
}
@@ -72,15 +73,15 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
_callbacks[entryIndex] = entry.Callback;
}
var fields = typeof(TState).GetFields();
FieldInfo[] fields = typeof(TState).GetFields();
int offset = 0;
for (int fieldIndex = 0; fieldIndex < fields.Length; fieldIndex++)
{
var field = fields[fieldIndex];
FieldInfo field = fields[fieldIndex];
var currentFieldOffset = (int)Marshal.OffsetOf<TState>(field.Name);
var nextFieldOffset = fieldIndex + 1 == fields.Length ? Unsafe.SizeOf<TState>() : (int)Marshal.OffsetOf<TState>(fields[fieldIndex + 1].Name);
int currentFieldOffset = (int)Marshal.OffsetOf<TState>(field.Name);
int nextFieldOffset = fieldIndex + 1 == fields.Length ? Unsafe.SizeOf<TState>() : (int)Marshal.OffsetOf<TState>(fields[fieldIndex + 1].Name);
int sizeOfField = nextFieldOffset - currentFieldOffset;

View File

@@ -3,6 +3,7 @@ using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Gpu.Engine.Threed.Blender;
using Ryujinx.Graphics.Gpu.Engine.Types;
using Ryujinx.Graphics.Gpu.Image;
using Ryujinx.Graphics.Gpu.Memory;
using Ryujinx.Graphics.Gpu.Shader;
using Ryujinx.Graphics.Shader;
using Ryujinx.Graphics.Texture;
@@ -463,8 +464,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="singleUse">If this is not -1, it indicates that only the given indexed target will be used.</param>
public void UpdateRenderTargetState(RenderTargetUpdateFlags updateFlags, int singleUse = -1)
{
var memoryManager = _channel.MemoryManager;
var rtControl = _state.State.RtControl;
MemoryManager memoryManager = _channel.MemoryManager;
RtControl rtControl = _state.State.RtControl;
bool useControl = updateFlags.HasFlag(RenderTargetUpdateFlags.UseControl);
bool layered = updateFlags.HasFlag(RenderTargetUpdateFlags.Layered);
@@ -473,12 +474,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
int count = useControl ? rtControl.UnpackCount() : Constants.TotalRenderTargets;
var msaaMode = _state.State.RtMsaaMode;
TextureMsaaMode msaaMode = _state.State.RtMsaaMode;
int samplesInX = msaaMode.SamplesInX();
int samplesInY = msaaMode.SamplesInY();
var scissor = _state.State.ScreenScissorState;
ScreenScissorState scissor = _state.State.ScreenScissorState;
Size sizeHint = new((scissor.X + scissor.Width) * samplesInX, (scissor.Y + scissor.Height) * samplesInY, 1);
int clipRegionWidth = int.MaxValue;
@@ -491,7 +492,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
{
int rtIndex = useControl ? rtControl.UnpackPermutationIndex(index) : index;
var colorState = _state.State.RtColorState[rtIndex];
RtColorState colorState = _state.State.RtColorState[rtIndex];
if (index >= count || !IsRtEnabled(colorState) || (singleColor && index != singleUse))
{
@@ -541,8 +542,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (dsEnable && updateFlags.HasFlag(RenderTargetUpdateFlags.UpdateDepthStencil))
{
var dsState = _state.State.RtDepthStencilState;
var dsSize = _state.State.RtDepthStencilSize;
RtDepthStencilState dsState = _state.State.RtDepthStencilState;
Size3D dsSize = _state.State.RtDepthStencilSize;
depthStencil = memoryManager.Physical.TextureCache.FindOrCreateTexture(
memoryManager,
@@ -643,7 +644,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (_state.State.YControl.HasFlag(YControl.NegateY))
{
ref var screenScissor = ref _state.State.ScreenScissorState;
ref ScreenScissorState screenScissor = ref _state.State.ScreenScissorState;
y = screenScissor.Height - height - y;
if (y < 0)
@@ -721,8 +722,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateViewportTransform()
{
var yControl = _state.State.YControl;
var face = _state.State.FaceState;
YControl yControl = _state.State.YControl;
FaceState face = _state.State.FaceState;
bool disableTransform = _state.State.ViewportTransformEnable == 0;
bool yNegate = yControl.HasFlag(YControl.NegateY);
@@ -736,17 +737,17 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
{
if (disableTransform)
{
ref var scissor = ref _state.State.ScreenScissorState;
ref ScreenScissorState scissor = ref _state.State.ScreenScissorState;
float rScale = _channel.TextureManager.RenderTargetScale;
var scissorRect = new Rectangle<float>(0, 0, (scissor.X + scissor.Width) * rScale, (scissor.Y + scissor.Height) * rScale);
Rectangle<float> scissorRect = new Rectangle<float>(0, 0, (scissor.X + scissor.Width) * rScale, (scissor.Y + scissor.Height) * rScale);
viewports[index] = new Viewport(scissorRect, ViewportSwizzle.PositiveX, ViewportSwizzle.PositiveY, ViewportSwizzle.PositiveZ, ViewportSwizzle.PositiveW, 0, 1);
continue;
}
ref var transform = ref _state.State.ViewportTransform[index];
ref var extents = ref _state.State.ViewportExtents[index];
ref ViewportTransform transform = ref _state.State.ViewportTransform[index];
ref ViewportExtents extents = ref _state.State.ViewportExtents[index];
float scaleX = MathF.Abs(transform.ScaleX);
float scaleY = transform.ScaleY;
@@ -841,7 +842,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateDepthBiasState()
{
var depthBias = _state.State.DepthBiasState;
DepthBiasState depthBias = _state.State.DepthBiasState;
float factor = _state.State.DepthBiasFactor;
float units = _state.State.DepthBiasUnits;
@@ -862,9 +863,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateStencilTestState()
{
var backMasks = _state.State.StencilBackMasks;
var test = _state.State.StencilTestState;
var backTest = _state.State.StencilBackTestState;
StencilBackMasks backMasks = _state.State.StencilBackMasks;
StencilTestState test = _state.State.StencilTestState;
StencilBackTestState backTest = _state.State.StencilBackTestState;
CompareOp backFunc;
StencilOp backSFail;
@@ -934,10 +935,10 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateSamplerPoolState()
{
var texturePool = _state.State.TexturePoolState;
var samplerPool = _state.State.SamplerPoolState;
PoolState texturePool = _state.State.TexturePoolState;
PoolState samplerPool = _state.State.SamplerPoolState;
var samplerIndex = _state.State.SamplerIndex;
SamplerIndex samplerIndex = _state.State.SamplerIndex;
int maximumId = samplerIndex == SamplerIndex.ViaHeaderIndex
? texturePool.MaximumId
@@ -951,7 +952,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateTexturePoolState()
{
var texturePool = _state.State.TexturePoolState;
PoolState texturePool = _state.State.TexturePoolState;
_channel.TextureManager.SetGraphicsTexturePool(texturePool.Address.Pack(), texturePool.MaximumId);
_channel.TextureManager.SetGraphicsTextureBufferIndex((int)_state.State.TextureBufferIndex);
@@ -971,7 +972,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
for (int index = 0; index < Constants.TotalVertexAttribs; index++)
{
var vertexAttrib = _state.State.VertexAttribState[index];
VertexAttribState vertexAttrib = _state.State.VertexAttribState[index];
int bufferIndex = vertexAttrib.UnpackBufferIndex();
@@ -1065,7 +1066,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateIndexBufferState()
{
var indexBuffer = _state.State.IndexBufferState;
IndexBufferState indexBuffer = _state.State.IndexBufferState;
if (_drawState.IndexCount == 0)
{
@@ -1109,7 +1110,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
for (int index = 0; index < Constants.TotalVertexBuffers; index++)
{
var vertexBuffer = _state.State.VertexBufferState[index];
VertexBufferState vertexBuffer = _state.State.VertexBufferState[index];
if (!vertexBuffer.UnpackEnable())
{
@@ -1193,8 +1194,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateFaceState()
{
var yControl = _state.State.YControl;
var face = _state.State.FaceState;
YControl yControl = _state.State.YControl;
FaceState face = _state.State.FaceState;
_pipeline.CullEnable = face.CullEnable;
_pipeline.CullMode = face.CullFace;
@@ -1233,7 +1234,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
for (int index = 0; index < Constants.TotalRenderTargets; index++)
{
var colorMask = _state.State.RtColorMask[rtColorMaskShared ? 0 : index];
RtColorMask colorMask = _state.State.RtColorMask[rtColorMaskShared ? 0 : index];
uint componentMask;
@@ -1256,7 +1257,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
{
if (_state.State.BlendUcodeEnable != BlendUcodeEnable.Disabled)
{
if (_context.Capabilities.SupportsBlendEquationAdvanced && _blendManager.TryGetAdvancedBlend(out var blendDescriptor))
if (_context.Capabilities.SupportsBlendEquationAdvanced && _blendManager.TryGetAdvancedBlend(out AdvancedBlendDescriptor blendDescriptor))
{
// Try to HLE it using advanced blend on the host if we can.
_context.Renderer.Pipeline.SetBlendState(blendDescriptor);
@@ -1278,9 +1279,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
for (int index = 0; index < Constants.TotalRenderTargets; index++)
{
bool enable = _state.State.BlendEnable[index];
var blend = _state.State.BlendState[index];
BlendState blend = _state.State.BlendState[index];
var descriptor = new BlendDescriptor(
BlendDescriptor descriptor = new BlendDescriptor(
enable,
blendConstant,
blend.ColorOp,
@@ -1306,9 +1307,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
else
{
bool enable = _state.State.BlendEnable[0];
var blend = _state.State.BlendStateCommon;
BlendStateCommon blend = _state.State.BlendStateCommon;
var descriptor = new BlendDescriptor(
BlendDescriptor descriptor = new BlendDescriptor(
enable,
blendConstant,
blend.ColorOp,
@@ -1409,7 +1410,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateShaderState()
{
var shaderCache = _channel.MemoryManager.Physical.ShaderCache;
ShaderCache shaderCache = _channel.MemoryManager.Physical.ShaderCache;
_vtgWritesRtLayer = false;
@@ -1420,7 +1421,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
for (int index = 0; index < 6; index++)
{
var shader = _state.State.ShaderState[index];
ShaderState shader = _state.State.ShaderState[index];
if (!shader.UnpackEnable() && index != 1)
{
continue;
@@ -1525,7 +1526,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// </summary>
private void UpdateSupportBufferViewportSize()
{
ref var transform = ref _state.State.ViewportTransform[0];
ref ViewportTransform transform = ref _state.State.ViewportTransform[0];
float scaleX = MathF.Abs(transform.ScaleX);
float scaleY = transform.ScaleY;
@@ -1564,8 +1565,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <returns>Current depth mode</returns>
private DepthMode GetDepthMode()
{
ref var transform = ref _state.State.ViewportTransform[0];
ref var extents = ref _state.State.ViewportExtents[0];
ref ViewportTransform transform = ref _state.State.ViewportTransform[0];
ref ViewportExtents extents = ref _state.State.ViewportExtents[0];
DepthMode depthMode;

View File

@@ -82,8 +82,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
_i2mClass = new InlineToMemoryClass(context, channel, initializeState: false);
var spec = new SpecializationStateUpdater(context);
var drawState = new DrawState();
SpecializationStateUpdater spec = new SpecializationStateUpdater(context);
DrawState drawState = new DrawState();
_drawManager = new DrawManager(context, channel, _state, drawState, spec);
_blendManager = new AdvancedBlendManager(_state);
@@ -253,8 +253,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
}
else
{
ref var lhsVec = ref Unsafe.As<T, Vector128<uint>>(ref lhs);
ref var rhsVec = ref Unsafe.As<T, Vector128<uint>>(ref rhs);
ref Vector128<uint> lhsVec = ref Unsafe.As<T, Vector128<uint>>(ref lhs);
ref Vector128<uint> rhsVec = ref Unsafe.As<T, Vector128<uint>>(ref rhs);
return Vector128.EqualsAll(lhsVec, rhsVec) &&
Vector128.EqualsAll(Unsafe.Add(ref lhsVec, 1), Unsafe.Add(ref rhsVec, 1));
@@ -267,8 +267,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="masks">Blend enable</param>
public void UpdateBlendEnable(ref Array8<Boolean32> enable)
{
var shadow = ShadowMode;
ref var state = ref _state.State.BlendEnable;
SetMmeShadowRamControlMode shadow = ShadowMode;
ref Array8<Boolean32> state = ref _state.State.BlendEnable;
if (shadow.IsReplay())
{
@@ -294,8 +294,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="masks">Color masks</param>
public void UpdateColorMasks(ref Array8<RtColorMask> masks)
{
var shadow = ShadowMode;
ref var state = ref _state.State.RtColorMask;
SetMmeShadowRamControlMode shadow = ShadowMode;
ref Array8<RtColorMask> state = ref _state.State.RtColorMask;
if (shadow.IsReplay())
{
@@ -323,12 +323,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="type">Type of the binding</param>
public void UpdateIndexBuffer(uint addrHigh, uint addrLow, IndexType type)
{
var shadow = ShadowMode;
ref var state = ref _state.State.IndexBufferState;
SetMmeShadowRamControlMode shadow = ShadowMode;
ref IndexBufferState state = ref _state.State.IndexBufferState;
if (shadow.IsReplay())
{
ref var shadowState = ref _state.ShadowState.IndexBufferState;
ref IndexBufferState shadowState = ref _state.ShadowState.IndexBufferState;
addrHigh = shadowState.Address.High;
addrLow = shadowState.Address.Low;
type = shadowState.Type;
@@ -345,7 +345,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (shadow.IsTrack())
{
ref var shadowState = ref _state.ShadowState.IndexBufferState;
ref IndexBufferState shadowState = ref _state.ShadowState.IndexBufferState;
shadowState.Address.High = addrHigh;
shadowState.Address.Low = addrLow;
shadowState.Type = type;
@@ -360,12 +360,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="addrLow">Low part of the address</param>
public void UpdateUniformBufferState(int size, uint addrHigh, uint addrLow)
{
var shadow = ShadowMode;
ref var state = ref _state.State.UniformBufferState;
SetMmeShadowRamControlMode shadow = ShadowMode;
ref UniformBufferState state = ref _state.State.UniformBufferState;
if (shadow.IsReplay())
{
ref var shadowState = ref _state.ShadowState.UniformBufferState;
ref UniformBufferState shadowState = ref _state.ShadowState.UniformBufferState;
size = shadowState.Size;
addrHigh = shadowState.Address.High;
addrLow = shadowState.Address.Low;
@@ -377,7 +377,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (shadow.IsTrack())
{
ref var shadowState = ref _state.ShadowState.UniformBufferState;
ref UniformBufferState shadowState = ref _state.ShadowState.UniformBufferState;
shadowState.Size = size;
shadowState.Address.High = addrHigh;
shadowState.Address.Low = addrLow;
@@ -391,8 +391,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="offset">Offset to update with</param>
public void SetShaderOffset(int index, uint offset)
{
var shadow = ShadowMode;
ref var shaderState = ref _state.State.ShaderState[index];
SetMmeShadowRamControlMode shadow = ShadowMode;
ref ShaderState shaderState = ref _state.State.ShaderState[index];
if (shadow.IsReplay())
{
@@ -418,8 +418,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <param name="ubState">Uniform buffer state</param>
public void UpdateUniformBufferState(UniformBufferState ubState)
{
var shadow = ShadowMode;
ref var state = ref _state.State.UniformBufferState;
SetMmeShadowRamControlMode shadow = ShadowMode;
ref UniformBufferState state = ref _state.State.UniformBufferState;
if (shadow.IsReplay())
{