misc: chore: Use explicit types in GAL

This commit is contained in:
Evan Husted 2025-01-25 14:14:40 -06:00
parent 69e0b79bd9
commit 93539e7d45
3 changed files with 9 additions and 9 deletions

View File

@ -359,7 +359,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
public bool TryHostConditionalRendering(ICounterEvent value, ulong compare, bool isEqual) public bool TryHostConditionalRendering(ICounterEvent value, ulong compare, bool isEqual)
{ {
var evt = value as ThreadedCounterEvent; ThreadedCounterEvent evt = value as ThreadedCounterEvent;
if (evt != null) if (evt != null)
{ {
if (compare == 0 && evt.Type == CounterType.SamplesPassed && evt.ClearCounter) if (compare == 0 && evt.Type == CounterType.SamplesPassed && evt.ClearCounter)

View File

@ -294,7 +294,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
public IImageArray CreateImageArray(int size, bool isBuffer) public IImageArray CreateImageArray(int size, bool isBuffer)
{ {
var imageArray = new ThreadedImageArray(this); ThreadedImageArray imageArray = new(this);
New<CreateImageArrayCommand>().Set(Ref(imageArray), size, isBuffer); New<CreateImageArrayCommand>().Set(Ref(imageArray), size, isBuffer);
QueueCommand(); QueueCommand();
@ -303,7 +303,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
public IProgram CreateProgram(ShaderSource[] shaders, ShaderInfo info) public IProgram CreateProgram(ShaderSource[] shaders, ShaderInfo info)
{ {
var program = new ThreadedProgram(this); ThreadedProgram program = new(this);
SourceProgramRequest request = new(program, shaders, info); SourceProgramRequest request = new(program, shaders, info);
@ -319,7 +319,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
public ISampler CreateSampler(SamplerCreateInfo info) public ISampler CreateSampler(SamplerCreateInfo info)
{ {
var sampler = new ThreadedSampler(this); ThreadedSampler sampler = new(this);
New<CreateSamplerCommand>().Set(Ref(sampler), info); New<CreateSamplerCommand>().Set(Ref(sampler), info);
QueueCommand(); QueueCommand();
@ -337,7 +337,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
{ {
if (IsGpuThread()) if (IsGpuThread())
{ {
var texture = new ThreadedTexture(this, info); ThreadedTexture texture = new ThreadedTexture(this, info);
New<CreateTextureCommand>().Set(Ref(texture), info); New<CreateTextureCommand>().Set(Ref(texture), info);
QueueCommand(); QueueCommand();
@ -345,7 +345,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
} }
else else
{ {
var texture = new ThreadedTexture(this, info) ThreadedTexture texture = new ThreadedTexture(this, info)
{ {
Base = _baseRenderer.CreateTexture(info), Base = _baseRenderer.CreateTexture(info),
}; };
@ -355,7 +355,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
} }
public ITextureArray CreateTextureArray(int size, bool isBuffer) public ITextureArray CreateTextureArray(int size, bool isBuffer)
{ {
var textureArray = new ThreadedTextureArray(this); ThreadedTextureArray textureArray = new ThreadedTextureArray(this);
New<CreateTextureArrayCommand>().Set(Ref(textureArray), size, isBuffer); New<CreateTextureArrayCommand>().Set(Ref(textureArray), size, isBuffer);
QueueCommand(); QueueCommand();
@ -414,7 +414,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
public IProgram LoadProgramBinary(byte[] programBinary, bool hasFragmentShader, ShaderInfo info) public IProgram LoadProgramBinary(byte[] programBinary, bool hasFragmentShader, ShaderInfo info)
{ {
var program = new ThreadedProgram(this); ThreadedProgram program = new ThreadedProgram(this);
BinaryProgramRequest request = new(program, programBinary, hasFragmentShader, info); BinaryProgramRequest request = new(program, programBinary, hasFragmentShader, info);
Programs.Add(request); Programs.Add(request);

View File

@ -126,7 +126,7 @@ namespace Ryujinx.Graphics.GAL
if (Descriptors != null) if (Descriptors != null)
{ {
foreach (var descriptor in Descriptors) foreach (ResourceDescriptor descriptor in Descriptors)
{ {
hasher.Add(descriptor); hasher.Add(descriptor);
} }