mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-09-14 14:05:10 +00:00
misc: chore: Use collection expressions in Gpu project
This commit is contained in:
@@ -224,7 +224,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
||||
TranslatorContext translatorContext = DecodeComputeShader(gpuAccessor, _context.Capabilities.Api, gpuVa);
|
||||
TranslatedShader translatedShader = TranslateShader(_dumper, channel, translatorContext, cachedGuestCode, asCompute: false);
|
||||
|
||||
ShaderSource[] shaderSourcesArray = new ShaderSource[] { CreateShaderSource(translatedShader.Program) };
|
||||
ShaderSource[] shaderSourcesArray = [CreateShaderSource(translatedShader.Program)];
|
||||
ShaderInfo info = ShaderInfoBuilder.BuildForCompute(
|
||||
_context,
|
||||
translatedShader.Program.Info,
|
||||
@@ -369,7 +369,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
||||
bool geometryToCompute = ShouldConvertGeometryToCompute(_context, geometryHasStore);
|
||||
|
||||
CachedShaderStage[] shaders = new CachedShaderStage[Constants.ShaderStages + 1];
|
||||
List<ShaderSource> shaderSources = new();
|
||||
List<ShaderSource> shaderSources = [];
|
||||
|
||||
TranslatorContext previousStage = null;
|
||||
ShaderInfoBuilder infoBuilder = new(_context, transformFeedbackDescriptors != null, vertexToCompute);
|
||||
@@ -537,7 +537,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
||||
ShaderSource source = new(program.Code, program.BinaryCode, ShaderStage.Compute, program.Language);
|
||||
ShaderInfo info = ShaderInfoBuilder.BuildForVertexAsCompute(_context, program.Info, context.GetVertexAsComputeInfo(), tfEnabled);
|
||||
|
||||
return new(_context.Renderer.CreateProgram(new[] { source }, info), program.Info, context.GetResourceReservations());
|
||||
return new(_context.Renderer.CreateProgram([source], info), program.Info, context.GetResourceReservations());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -802,7 +802,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
||||
{
|
||||
if (address == MemoryManager.PteUnmapped || size == 0)
|
||||
{
|
||||
return Array.Empty<byte>();
|
||||
return [];
|
||||
}
|
||||
|
||||
return memoryManager.Physical.GetSpan(address, size).ToArray();
|
||||
|
Reference in New Issue
Block a user