-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Release 1.5.1 windows exe seems to throw errors when HLSL arrays are used.
Building with shader_minifier.exe -o shaders.h --hlsl --format c-array --no-renaming-list VS VertexShader.hlsl
Array at global scope
static const float2 positions[3] =
{
{ -1.0, 1.0 },
{ 3.0, 1.0 },
{ -1.0, -3.0 },
};
float4 VS(uint id : SV_VertexID) : SV_POSITION
{
return float4(positions[id], 0.0, 1.0);
}
Output:
System.AggregateException: One or more errors occurred. ---> System.Exception: Parse error: Error in VertexShader.hlsl: Ln: 1 Col: 30
static const float2 positions[3] =
^
Expecting: '('
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1448.Invoke(String message)
at <StartupCode$shader_minifier>.$Api.parseAndRewrite@23.Invoke(Tuple`2 tupledArg)
at Microsoft.FSharp.Collections.ArrayModule.Parallel.Map@2270-2.Invoke(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
at Microsoft.FSharp.Collections.ArrayModule.Parallel.Map[T,TResult](FSharpFunc`2 mapping, T[] array)
at ShaderMinifier.Minifier.minify(Options options, Tuple`2[] files)
at ShaderMinifier.Minifier..ctor(Options options, Tuple`2[] files)
at Main.minifyFiles(Options options, IEnumerable`1 filenames, TextWriter out)
at Main.run(Options options, IEnumerable`1 filenames)
---> (Inner Exception #0) System.Exception: Parse error: Error in VertexShader.hlsl: Ln: 1 Col: 30
static const float2 positions[3] =
^
Expecting: '('
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1448.Invoke(String message)
at <StartupCode$shader_minifier>.$Api.parseAndRewrite@23.Invoke(Tuple`2 tupledArg)
at Microsoft.FSharp.Collections.ArrayModule.Parallel.Map@2270-2.Invoke(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)<---
Array at local scope
float4 VS(uint id : SV_VertexID) : SV_POSITION
{
float2 positions[3] =
{
{ -1.0, 1.0 },
{ 3.0, 1.0 },
{ -1.0, -3.0 },
};
return float4(positions[id], 0.0, 1.0);
}
Output:
System.AggregateException: One or more errors occurred. ---> System.Exception: Parse error: Error in VertexShader.hlsl: Ln: 3 Col: 16 (UTF16-Col: 9)
float2 positions[3] =
^
Note: The column count assumes a tab stop distance of 8 chars.
Expecting: infix operator, postfix operator, ',' or ';'
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1448.Invoke(String message)
at <StartupCode$shader_minifier>.$Api.parseAndRewrite@23.Invoke(Tuple`2 tupledArg)
at Microsoft.FSharp.Collections.ArrayModule.Parallel.Map@2270-2.Invoke(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
at Microsoft.FSharp.Collections.ArrayModule.Parallel.Map[T,TResult](FSharpFunc`2 mapping, T[] array)
at ShaderMinifier.Minifier.minify(Options options, Tuple`2[] files)
at ShaderMinifier.Minifier..ctor(Options options, Tuple`2[] files)
at Main.minifyFiles(Options options, IEnumerable`1 filenames, TextWriter out)
at Main.run(Options options, IEnumerable`1 filenames)
---> (Inner Exception #0) System.Exception: Parse error: Error in VertexShader.hlsl: Ln: 3 Col: 16 (UTF16-Col: 9)
float2 positions[3] =
^
Note: The column count assumes a tab stop distance of 8 chars.
Expecting: infix operator, postfix operator, ',' or ';'
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1448.Invoke(String message)
at <StartupCode$shader_minifier>.$Api.parseAndRewrite@23.Invoke(Tuple`2 tupledArg)
at Microsoft.FSharp.Collections.ArrayModule.Parallel.Map@2270-2.Invoke(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)<---
Please let me know if this is user error. Thanks.
Metadata
Metadata
Assignees
Labels
No labels