Bug 231475 - REGRESSION (iOS 15), safari604.1: Could not link the shader program
Summary: REGRESSION (iOS 15), safari604.1: Could not link the shader program
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad Other
: P1 Blocker
Assignee: Kyle Piddington
URL: http://106.55.234.68/3d-showroom/wgl1/
Keywords: InRadar
Depends on:
Blocks: anglemetalregr
  Show dependency treegraph
 
Reported: 2021-10-09 02:58 PDT by SaxonGao
Modified: 2021-10-25 16:41 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.37 KB, patch)
2021-10-22 16:06 PDT, Kyle Piddington
no flags Details | Formatted Diff | Diff
Patch (6.20 KB, patch)
2021-10-22 16:33 PDT, Kyle Piddington
no flags Details | Formatted Diff | Diff
Patch for landing (6.17 KB, patch)
2021-10-25 14:22 PDT, Kyle Piddington
no flags Details | Formatted Diff | Diff
Patch for landing (6.17 KB, patch)
2021-10-25 16:09 PDT, Kyle Piddington
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description SaxonGao 2021-10-09 02:58:37 PDT
OS: iOS 15.0.1

kha.js:formatted:30842 Could not link the shader program:
Internal error compiling shader with Metal backend.
Please submit this shader, or website as a bug to https://bugs.webkit.org


compile @ kha.js:formatted:30842
kha_graphics4_PerFramebufferPipelineCache @ kha.js:formatted:30842
(anonymous) @ kha.js:formatted:30842
kha_graphics4_ImageShaderPainter @ kha.js:formatted:30842
kha_graphics4_Graphics2 @ kha.js:formatted:30842
kha_js_graphics4_Graphics2 @ kha.js:formatted:30842
(anonymous) @ kha.js:formatted:30842
(anonymous) @ kha.js:formatted:30842
(anonymous) @ kha.js:formatted:30842
(anonymous) @ kha.js:formatted:30842
(anonymous) @ kha.js:formatted:30842
start @ kha.js:formatted:30842
(anonymous) @ kha.js:formatted:30842
(anonymous) @ VM41:333
(anonymous) @ kha.js:formatted:30842
(anonymous) @ kha.js:formatted:30842
Comment 1 Radar WebKit Bug Importer 2021-10-09 15:58:02 PDT
<rdar://problem/84066469>
Comment 2 Smoley 2021-10-21 17:06:31 PDT
Thanks for filing, I can reproduce this on the latest iOS 15.1 beta as well. Does not reproduce on iOS 14.7.1.
Comment 3 Kimmo Kinnunen 2021-10-22 01:01:45 PDT
[Error] Could not link the shader program:
Internal error compiling shader with Metal backend.
program_source:80:30: error: expected ';' at end of declaration list
  metal::float2 _utexPosition __unassigned_attribute__;
                             ^
                             ;
program_source:102:45: error: invalid type 'ANGLE_VertexIn' of input declaration with attribute 'stage_in' in a vertex function
vertex __VERTEX_OUT(ANGLE_VertexOut)  main0(ANGLE_VertexIn ANGLE_vertexIn [[stage_in]], constant ANGLE_UserUniforms & ANGLE_userUniforms [[buffer(19)]], constant ANGLE_AngleUniforms & ANGLE_angleUniforms [[buffer(17)]], uint ANGLE_instanceIdMod [[instance_id]], uint gl_VertexID [[vertex_id]]  )
                                            ^
program_source:80:3: note: field with missing attribute 'attribute' declared here
  metal::float2 _utexPosition __unassigned_attribute__;
  ^
Comment 4 Kimmo Kinnunen 2021-10-22 01:07:59 PDT
// GLSL
//
// #version 300 es
// 
// uniform mat4 projectionMatrix;
// 
// in vec3 vertexPosition;
// out vec2 texCoord;
// in vec2 texPosition;
// out vec4 color;
// in vec4 vertexColor;
// 
// void main()
// {
//     gl_Position = projectionMatrix * vec4(vertexPosition, 1.0);
//     texCoord = texPosition;
//     color = vertexColor;
// }
// 




#define ANGLE_ALWAYS_INLINE __attribute__((always_inline))

ANGLE_ALWAYS_INLINE int ANGLE_int_clamp(int value, int minValue, int maxValue)
{
    return ((value < minValue) ?  minValue : ((value > maxValue) ? maxValue : value));
};

#if TRANSFORM_FEEDBACK_ENABLED
    #define __VERTEX_OUT(args) void
#else
    #define __VERTEX_OUT(args) args
#endif

#define ANGLE_tensor metal::array
#pragma clang diagnostic ignored "-Wunused-value"
#define ANGLE_SAMPLE_COMPARE_GRADIENT_INDEX 0
#define ANGLE_SAMPLE_COMPARE_LOD_INDEX      1
#define ANGLE_RASTERIZATION_DISCARD_INDEX   2
#define ANGLE_COVERAGE_MASK_ENABLED_INDEX   3

constant bool ANGLE_UseSampleCompareGradient [[function_constant(ANGLE_SAMPLE_COMPARE_GRADIENT_INDEX)]];
constant bool ANGLE_UseSampleCompareLod      [[function_constant(ANGLE_SAMPLE_COMPARE_LOD_INDEX)]];
constant bool ANGLE_RasterizationDiscard     [[function_constant(ANGLE_RASTERIZATION_DISCARD_INDEX)]];
constant bool ANGLE_CoverageMaskEnabled      [[function_constant(ANGLE_COVERAGE_MASK_ENABLED_INDEX)]];

struct ANGLE_DepthRangeParams
{
  float ANGLE_near;
  float ANGLE_far;
  float ANGLE_diff;
  float ANGLE_reserved;
};

struct ANGLE_AngleUniforms
{
  metal::float4 ANGLE_viewport;
  metal::float2 ANGLE_halfRenderArea;
  metal::float2 ANGLE_flipXY;
  metal::float2 ANGLE_negFlipXY;
  uint ANGLE_clipDistancesEnabled;
  uint ANGLE_xfbActiveUnpaused;
  uint ANGLE_xfbVerticesPerDraw;
  metal::int4 ANGLE_xfbBufferOffsets;
  metal::uint4 ANGLE_acbBufferOffsets;
  ANGLE_DepthRangeParams ANGLE_depthRange;
  uint ANGLE_coverageMask;
};

struct ANGLE_UserUniforms
{
  metal::float4x4 _uprojectionMatrix;
};

struct ANGLE_VertexIn
{
  metal::float3 _uvertexPosition[[attribute(1)]];
  metal::float2 _utexPosition __unassigned_attribute__;
  metal::float4 _uvertexColor[[attribute(2)]];
};

struct ANGLE_VertexOut
{
  metal::float2 _utexCoord;
  metal::float4 _ucolor;
  metal::float4 gl_Position [[position]];
};

void ANGLE_0_main(thread ANGLE_VertexOut & ANGLE_vertexOut, thread ANGLE_VertexIn & ANGLE_vertexIn, constant ANGLE_UserUniforms & ANGLE_userUniforms)
{
  ANGLE_vertexOut.gl_Position = metal::float4(0.0f, 0.0f, 0.0f, 0.0f);
  ANGLE_vertexOut._ucolor = metal::float4(0.0f, 0.0f, 0.0f, 0.0f);
  ANGLE_vertexOut._utexCoord = metal::float2(0.0f, 0.0f);
  metal::float4 ANGLE_4 = metal::float4(ANGLE_vertexIn._uvertexPosition, 1.0f);
  ANGLE_vertexOut.gl_Position = (ANGLE_userUniforms._uprojectionMatrix * ANGLE_4);
  ANGLE_vertexOut._utexCoord = ANGLE_vertexIn._utexPosition;
  ANGLE_vertexOut._ucolor = ANGLE_vertexIn._uvertexColor;
}

vertex __VERTEX_OUT(ANGLE_VertexOut)  main0(ANGLE_VertexIn ANGLE_vertexIn [[stage_in]], constant ANGLE_UserUniforms & ANGLE_userUniforms [[buffer(19)]], constant ANGLE_AngleUniforms & ANGLE_angleUniforms [[buffer(17)]], uint ANGLE_instanceIdMod [[instance_id]], uint gl_VertexID [[vertex_id]]  )
{
  ANGLE_VertexOut ANGLE_vertexOut;
  {
    ANGLE_0_main(ANGLE_vertexOut, ANGLE_vertexIn, ANGLE_userUniforms);
    
    ANGLE_vertexOut.gl_Position.z = (ANGLE_vertexOut.gl_Position.z * ANGLE_angleUniforms.ANGLE_depthRange.ANGLE_reserved);
    float ANGLE_7 = (ANGLE_vertexOut.gl_Position.z + ANGLE_vertexOut.gl_Position.w);
    ANGLE_vertexOut.gl_Position.z = (ANGLE_7 * 0.5f);
    ANGLE_vertexOut.gl_Position.y = (ANGLE_vertexOut.gl_Position.y * ANGLE_angleUniforms.ANGLE_negFlipXY.y);
    if (ANGLE_RasterizationDiscard)
    {
      ANGLE_vertexOut.gl_Position = metal::float4(-3.0f, -3.0f, -3.0f, 1.0f);
    } else {}
  }
  #if TRANSFORM_FEEDBACK_ENABLED
  return;
  #else
  return ANGLE_vertexOut;
  #endif

}


http://106.55.234.68/3d-showroom/wgl1/kha.js:1:108144: CONSOLE LOG kha/graphics4/PipelineState.hx:49: Error: Could not link the shader program:
Internal error compiling shader with Metal backend.
program_source:80:30: error: expected ';' at end of declaration list
  metal::float2 _utexPosition __unassigned_attribute__;
                             ^
                             ;
program_source:102:45: error: invalid type 'ANGLE_VertexIn' of input declaration with attribute 'stage_in' in a vertex function
vertex __VERTEX_OUT(ANGLE_VertexOut)  main0(ANGLE_VertexIn ANGLE_vertexIn [[stage_in]], constant ANGLE_UserUniforms & ANGLE_userUniforms [[buffer(19)]], constant ANGLE_AngleUniforms & ANGLE_angleUniforms [[buffer(17)]], uint ANGLE_instanceIdMod [[instance_id]], uint gl_VertexID [[vertex_id]]  )
                                            ^
program_source:80:3: note: field with missing attribute 'attribute' declared here
  metal::float2 _utexPosition __unassigned_attribute__;
  ^



http://106.55.234.68/3d-showroom/wgl1/kha.js:1:698459: CONSOLE JS ERROR Could not link the shader program:
Internal error compiling shader with Metal backend.
program_source:80:30: error: expected ';' at end of declaration list
  metal::float2 _utexPosition __unassigned_attribute__;
                             ^
                             ;
program_source:102:45: error: invalid type 'ANGLE_VertexIn' of input declaration with attribute 'stage_in' in a vertex function
vertex __VERTEX_OUT(ANGLE_VertexOut)  main0(ANGLE_VertexIn ANGLE_vertexIn [[stage_in]], constant ANGLE_UserUniforms & ANGLE_userUniforms [[buffer(19)]], constant ANGLE_AngleUniforms & ANGLE_angleUniforms [[buffer(17)]], uint ANGLE_instanceIdMod [[instance_id]], uint gl_VertexID [[vertex_id]]  )
                                            ^
program_source:80:3: note: field with missing attribute 'attribute' declared here
  metal::float2 _utexPosition __unassigned_attribute__;
  ^
Comment 5 Kyle Piddington 2021-10-22 16:06:51 PDT
Created attachment 442210 [details]
Patch
Comment 6 EWS Watchlist 2021-10-22 16:07:54 PDT
Note that there are important steps to take when updating ANGLE. See https://trac.webkit.org/wiki/UpdatingANGLE
Comment 7 Dean Jackson 2021-10-22 16:08:27 PDT
Comment on attachment 442210 [details]
Patch

Could you put in a test?
Comment 8 Kyle Piddington 2021-10-22 16:33:22 PDT
Created attachment 442218 [details]
Patch
Comment 9 Kyle Piddington 2021-10-25 14:22:24 PDT
Created attachment 442417 [details]
Patch for landing
Comment 10 EWS 2021-10-25 15:56:20 PDT
Found 1 new test failure: fast/canvas/webgl/attrib-name-aliasing-bug.html
Comment 11 Kyle Piddington 2021-10-25 16:09:45 PDT
Created attachment 442435 [details]
Patch for landing
Comment 12 EWS 2021-10-25 16:41:52 PDT
Committed r284849 (243526@main): <https://commits.webkit.org/243526@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442435 [details].