diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-05-05 22:02:28 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-06 11:02:28 +1000 |
| commit | b8eb6abeccbd4a468214a4d2ad3a9b6e5e06973c (patch) | |
| tree | cd3d71ebde0f4f32eb674778adae89c0efcb75df /Ryujinx.Graphics.Shader/Instructions | |
| parent | 7f500e7cae940958289abe1a3461e52684742053 (diff) | |
Refactor shader GPU state and memory access (#1203)
* Refactor shader GPU state and memory access
* Fix NVDEC project build
* Address PR feedback and add missing XML comments
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions')
6 files changed, 24 insertions, 24 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitConversion.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitConversion.cs index 8716d4e7..c4c6c55b 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitConversion.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitConversion.cs @@ -72,7 +72,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (intType == IntegerType.U64) { - context.Config.PrintLog("Unimplemented 64-bits F2I."); + context.Config.GpuAccessor.Log("Unimplemented 64-bits F2I."); return; } @@ -184,7 +184,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (srcType == IntegerType.U64 || dstType == IntegerType.U64) { - context.Config.PrintLog("Invalid I2I encoding."); + context.Config.GpuAccessor.Log("Invalid I2I encoding."); return; } diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs index 1da5158f..6dc4c093 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs @@ -431,7 +431,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (scale.AsFloat() == 1) { - context.Config.PrintLog($"Invalid FP multiply scale \"{op.Scale}\"."); + context.Config.GpuAccessor.Log($"Invalid FP multiply scale \"{op.Scale}\"."); } if (isFP64) diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs index 7eb88883..2418293d 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs @@ -88,7 +88,7 @@ namespace Ryujinx.Graphics.Shader.Instructions } else { - context.Config.PrintLog($"Invalid barrier mode: {op.Mode}."); + context.Config.GpuAccessor.Log($"Invalid barrier mode: {op.Mode}."); } } @@ -141,7 +141,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (op.Size > IntegerSize.B64) { - context.Config.PrintLog($"Invalid LDC size: {op.Size}."); + context.Config.GpuAccessor.Log($"Invalid LDC size: {op.Size}."); } bool isSmallInt = op.Size < IntegerSize.B32; @@ -209,7 +209,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (!(emit || cut)) { - context.Config.PrintLog("Invalid OUT encoding."); + context.Config.GpuAccessor.Log("Invalid OUT encoding."); } if (emit) @@ -274,7 +274,7 @@ namespace Ryujinx.Graphics.Shader.Instructions } else { - context.Config.PrintLog($"Invalid reduction type: {type}."); + context.Config.GpuAccessor.Log($"Invalid reduction type: {type}."); } break; case AtomicOp.BitwiseAnd: @@ -284,7 +284,7 @@ namespace Ryujinx.Graphics.Shader.Instructions } else { - context.Config.PrintLog($"Invalid reduction type: {type}."); + context.Config.GpuAccessor.Log($"Invalid reduction type: {type}."); } break; case AtomicOp.BitwiseExclusiveOr: @@ -294,7 +294,7 @@ namespace Ryujinx.Graphics.Shader.Instructions } else { - context.Config.PrintLog($"Invalid reduction type: {type}."); + context.Config.GpuAccessor.Log($"Invalid reduction type: {type}."); } break; case AtomicOp.BitwiseOr: @@ -304,7 +304,7 @@ namespace Ryujinx.Graphics.Shader.Instructions } else { - context.Config.PrintLog($"Invalid reduction type: {type}."); + context.Config.GpuAccessor.Log($"Invalid reduction type: {type}."); } break; case AtomicOp.Maximum: @@ -318,7 +318,7 @@ namespace Ryujinx.Graphics.Shader.Instructions } else { - context.Config.PrintLog($"Invalid reduction type: {type}."); + context.Config.GpuAccessor.Log($"Invalid reduction type: {type}."); } break; case AtomicOp.Minimum: @@ -332,7 +332,7 @@ namespace Ryujinx.Graphics.Shader.Instructions } else { - context.Config.PrintLog($"Invalid reduction type: {type}."); + context.Config.GpuAccessor.Log($"Invalid reduction type: {type}."); } break; } @@ -346,7 +346,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (op.Size > IntegerSize.B128) { - context.Config.PrintLog($"Invalid load size: {op.Size}."); + context.Config.GpuAccessor.Log($"Invalid load size: {op.Size}."); } bool isSmallInt = op.Size < IntegerSize.B32; @@ -432,7 +432,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (op.Size > IntegerSize.B128) { - context.Config.PrintLog($"Invalid store size: {op.Size}."); + context.Config.GpuAccessor.Log($"Invalid store size: {op.Size}."); } bool isSmallInt = op.Size < IntegerSize.B32; diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs index efc80b0c..264c732d 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs @@ -32,7 +32,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (isCC) { // TODO: Support Register to condition code flags copy. - context.Config.PrintLog("R2P.CC not implemented."); + context.Config.GpuAccessor.Log("R2P.CC not implemented."); } else { diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs index 18552d0a..7f7a48a6 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs @@ -19,7 +19,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (type == SamplerType.None) { - context.Config.PrintLog("Invalid image store sampler type."); + context.Config.GpuAccessor.Log("Invalid image store sampler type."); return; } @@ -158,7 +158,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (type == SamplerType.None) { - context.Config.PrintLog("Invalid image store sampler type."); + context.Config.GpuAccessor.Log("Invalid image store sampler type."); return; } @@ -344,7 +344,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (type == SamplerType.None) { - context.Config.PrintLog("Invalid texture sampler type."); + context.Config.GpuAccessor.Log("Invalid texture sampler type."); return; } @@ -423,14 +423,14 @@ namespace Ryujinx.Graphics.Shader.Instructions if (type == SamplerType.None) { - context.Config.PrintLog("Invalid texel fetch sampler type."); + context.Config.GpuAccessor.Log("Invalid texel fetch sampler type."); return; } flags = ConvertTextureFlags(tldsOp.Target) | TextureFlags.IntCoords; - if (tldsOp.Target == TexelLoadTarget.Texture1DLodZero && context.Config.QueryInfoBool(QueryInfoName.IsTextureBuffer, tldsOp.Immediate)) + if (tldsOp.Target == TexelLoadTarget.Texture1DLodZero && context.Config.GpuAccessor.QueryIsTextureBuffer(tldsOp.Immediate)) { type = SamplerType.TextureBuffer; flags &= ~TextureFlags.LodLevel; @@ -1020,7 +1020,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (type == SamplerType.Texture1D && flags == TextureFlags.IntCoords && !isBindless) { - bool isTypeBuffer = context.Config.QueryInfoBool(QueryInfoName.IsTextureBuffer, op.Immediate); + bool isTypeBuffer = context.Config.GpuAccessor.QueryIsTextureBuffer(op.Immediate); if (isTypeBuffer) { @@ -1093,11 +1093,11 @@ namespace Ryujinx.Graphics.Shader.Instructions private static TextureFormat GetTextureFormat(EmitterContext context, int handle) { - var format = (TextureFormat)context.Config.QueryInfo(QueryInfoName.TextureFormat, handle); + var format = context.Config.GpuAccessor.QueryTextureFormat(handle); if (format == TextureFormat.Unknown) { - context.Config.PrintLog($"Unknown format for texture {handle}."); + context.Config.GpuAccessor.Log($"Unknown format for texture {handle}."); format = TextureFormat.R8G8B8A8Unorm; } diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitVote.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitVote.cs index 8f81ecb4..5c16770a 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitVote.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitVote.cs @@ -36,7 +36,7 @@ namespace Ryujinx.Graphics.Shader.Instructions } else { - context.Config.PrintLog($"Invalid vote operation: {op.VoteOp}."); + context.Config.GpuAccessor.Log($"Invalid vote operation: {op.VoteOp}."); } if (!op.Rd.IsRZ) |
