3dba3ee465
This CL fixes cases where array dimensions could be placed on the type instead of the variable (`float[2] x` instead of `float x[2]`). It also reports errors in cases where arrays aren't syntactically valid in Metal, rather than emitting unusable Metal code. (Some of these cases are actually invalid GLSL as well! But those fixes are coming in followup CLs.) Change-Id: I22279127c8a9aa2f22bf5ea3d225e563c2e254f2 Bug: skia:10926, skia:10760, skia:10761 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340137 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
18 lines
452 B
Metal
18 lines
452 B
Metal
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
using namespace metal;
|
|
struct Uniforms {
|
|
float arr[1][2][3];
|
|
};
|
|
struct Inputs {
|
|
};
|
|
struct Outputs {
|
|
float4 sk_FragColor [[color(0)]];
|
|
};
|
|
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
|
Outputs _outputStruct;
|
|
thread Outputs* _out = &_outputStruct;
|
|
return *_out;
|
|
}
|