simplify and optimize some variables in DisplayManager
This commit is contained in:
parent
62b8ec4578
commit
f83602c1c9
|
@ -250,7 +250,7 @@ namespace BizHawk.Client.Common
|
|||
private FilterProgram BuildDefaultChain(Size chainInSize, Size chainOutSize, bool includeOSD, bool includeUserFilters)
|
||||
{
|
||||
// select user special FX shader chain
|
||||
var selectedChainProperties = new Dictionary<string, object>();
|
||||
KeyValuePair<string, float>[] selectedChainProperties = null;
|
||||
RetroShaderChain selectedChain = null;
|
||||
switch (GlobalConfig.TargetDisplayFilter)
|
||||
{
|
||||
|
@ -259,7 +259,7 @@ namespace BizHawk.Client.Common
|
|||
break;
|
||||
case 2 when _shaderChainScanlines is { Available: true }:
|
||||
selectedChain = _shaderChainScanlines;
|
||||
selectedChainProperties["uIntensity"] = 1.0f - GlobalConfig.TargetScanlineFilterIntensity / 256.0f;
|
||||
selectedChainProperties = [new("uIntensity", 1.0f - GlobalConfig.TargetScanlineFilterIntensity / 256.0f)];
|
||||
break;
|
||||
case 3 when _shaderChainUser is { Available: true }:
|
||||
selectedChain = _shaderChainUser;
|
||||
|
@ -377,7 +377,7 @@ namespace BizHawk.Client.Common
|
|||
return chain;
|
||||
}
|
||||
|
||||
private static void AppendRetroShaderChain(FilterProgram program, string name, RetroShaderChain retroChain, Dictionary<string, object> properties)
|
||||
private static void AppendRetroShaderChain(FilterProgram program, string name, RetroShaderChain retroChain, KeyValuePair<string, float>[] properties)
|
||||
{
|
||||
for (var i = 0; i < retroChain.Passes.Length; i++)
|
||||
{
|
||||
|
|
|
@ -45,8 +45,8 @@ namespace BizHawk.Client.Common.FilterManager
|
|||
{
|
||||
private readonly Dictionary<string, BaseFilter> _filterNameIndex = new();
|
||||
|
||||
public readonly IList<BaseFilter> Filters = new List<BaseFilter>();
|
||||
public readonly IList<ProgramStep> Program = new List<ProgramStep>();
|
||||
public readonly List<BaseFilter> Filters = new();
|
||||
public readonly List<ProgramStep> Program = new();
|
||||
|
||||
public BaseFilter this[string name]
|
||||
{
|
||||
|
@ -290,4 +290,4 @@ namespace BizHawk.Client.Common.FilterManager
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace BizHawk.Client.Common.Filters
|
|||
{
|
||||
}
|
||||
|
||||
public Dictionary<string, object> Parameters = new();
|
||||
public KeyValuePair<string, float>[] Parameters { get; set; }
|
||||
|
||||
public bool IsNop { get; protected set; }
|
||||
|
||||
|
|
|
@ -347,12 +347,9 @@ namespace BizHawk.Client.Common.Filters
|
|||
// apply all parameters to this shader.. even if it was meant for other shaders. kind of lame.
|
||||
if (Parameters != null)
|
||||
{
|
||||
foreach (var (k, v) in Parameters)
|
||||
foreach (var (k, value) in Parameters)
|
||||
{
|
||||
if (v is float value)
|
||||
{
|
||||
shader.Pipeline.SetUniform(k, value);
|
||||
}
|
||||
shader.Pipeline.SetUniform(k, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue