misc: chore: Use collection expressions in OpenGL project

This commit is contained in:
Evan Husted
2025-01-26 15:50:22 -06:00
parent aa0cb50c5d
commit a5dbcb75d0
8 changed files with 18 additions and 17 deletions

View File

@@ -7,7 +7,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects
{
public static int CompileProgram(string shaderCode, ShaderType shaderType)
{
return CompileProgram(new string[] { shaderCode }, shaderType);
return CompileProgram([shaderCode], shaderType);
}
public static int CompileProgram(string[] shaders, ShaderType shaderType)

View File

@@ -44,11 +44,11 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa
{
_renderer = renderer;
_edgeShaderPrograms = Array.Empty<int>();
_blendShaderPrograms = Array.Empty<int>();
_neighbourShaderPrograms = Array.Empty<int>();
_edgeShaderPrograms = [];
_blendShaderPrograms = [];
_neighbourShaderPrograms = [];
_qualities = new string[] { "SMAA_PRESET_LOW", "SMAA_PRESET_MEDIUM", "SMAA_PRESET_HIGH", "SMAA_PRESET_ULTRA" };
_qualities = ["SMAA_PRESET_LOW", "SMAA_PRESET_MEDIUM", "SMAA_PRESET_HIGH", "SMAA_PRESET_ULTRA"];
Quality = quality;
@@ -93,7 +93,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa
string blendShaderData = EmbeddedResources.ReadAllText("Ryujinx.Graphics.OpenGL/Effects/Shaders/smaa_blend.glsl");
string neighbourShaderData = EmbeddedResources.ReadAllText("Ryujinx.Graphics.OpenGL/Effects/Shaders/smaa_neighbour.glsl");
string[] shaders = new string[] { presets, edgeShaderData };
string[] shaders = [presets, edgeShaderData];
int edgeProgram = ShaderHelper.CompileProgram(shaders, ShaderType.ComputeShader);
shaders[1] = blendShaderData;