pygfx / shadertoy

Shadertoy implementation based on wgpu-py
BSD 2-Clause "Simplified" License
11 stars 1 forks source link

Most common errors with the Shadertoy utility #15

Open Vipitis opened 10 months ago

Vipitis commented 10 months ago

This issue lists the most common issue with shadercode with shaders from the website. It serves as a task list and will be updated as PRs are merged. (the data is based on a filtered dataset I mined a while ago)

number of shaders: 13576
number of valid shaders: 11481
number of errors during validation: 1958
number of value errors: 26
number of timeouts during validation: 10
number of panics during validation: 101

The most frequent errors are as follows:

naga:: Composing 0's component type is not expected                                                             231
InvalidToken(In, [Token(Void), Token(Struct), TypeName])                                                        117
naga:: The `return` value None does not match the function return value                                         114
panic                                                                                                           101
SemanticError("uniform/buffer blocks require layout(binding=X)")                                                 74
SemanticError("Unknown function 'dot'")                                                                          71
naga:: Type flags TypeFlags(DATA | COPY | HOST_SHAREABLE) do not meet the required TypeFlags(CONSTRUCTIBLE)      61
SemanticError("Can't resolve type: IncompatibleOperands(\"Dot(Scalar(Scalar { kind: Float, width: 4 }), _)\")")  60
SemanticError("Not implemented as constant expression: Normalize built-in function")                             58
SemanticError("Not implemented as constant expression: Acos built-in function")                                  54
SemanticError("Not implemented as constant expression: Sqrt built-in function")                                  52
PreprocessorError(DefineRedefined)                                                                               48
naga:: The type is not constructible                                                                             47
InvalidToken(Identifier("sampler2D"), [Token(RightParen)])                                                       42
SemanticError("Not implemented as constant expression: Cos built-in function")                                   36
SemanticError("Not implemented as constant expression: Fract built-in function")                                 29
invalid Shader Code                                                                                              26
SemanticError("Float literal is infinite")                                                                       23
SemanticError("Not implemented as constant expression: Atan built-in function")                                  22
SemanticError("Not implemented as constant expression: Radians built-in function")                               20
naga:: Local variable has a type [17] that can't be stored in a local variable.                                  15
naga:: Local variable has a type [10] that can't be stored in a local variable.                                  13
SemanticError("Can't lookup field on this type \"y\"")                                                           12
SemanticError("Can't lookup field on this type \"xz\"")                                                          11
other: timedout                                                                                                  10
naga:: Local variable has a type [11] that can't be stored in a local variable.                                   9
SemanticError("Not implemented as constant expression: Asin built-in function")                                   9
SemanticError("Not implemented as constant expression: Log built-in function")                                    9
SemanticError("Unknown function 'cos'")                                                                           8
SemanticError("Not implemented as constant expression: Sin built-in function")                                    8
SemanticError("Unknown function 'Rot2Cs'")                                                                        7
SemanticError("Unknown function 'inPolygon'")                                                                     7

Tasks list:

almarklein commented 10 months ago

Should this issue remain open as kind of an overview or do you prefer to only have the relevant issues/PR to specific errors?

I think this can be a nice overview. You can also keep a list in the top post where you link to all the issues and PR's that come from this work. This can then function as a "meta-issue" to track the matureness of the shadertoy util!

Vipitis commented 10 months ago

I cleaned up the top comment to act as a task list.

Vipitis commented 8 months ago

@Korijn could you transfer this issue to the shadertoy repo?

Korijn commented 8 months ago

@Korijn could you transfer this issue to the shadertoy repo?

Done!