Bug 201606

Summary: Upload triangles tests for 3D suite in MotionMark
Product: WebKit Reporter: Jon Lee <jonlee>
Component: WebGPUAssignee: Jon Lee <jonlee>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, dino, ews-watchlist, jond, justin_fan, mmaxfield, rniwa, sabouhallawa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=201609
Attachments:
Description Flags
Patch none

Description Jon Lee 2019-09-09 10:39:58 PDT
...
Comment 1 Jon Lee 2019-09-09 10:58:33 PDT
Created attachment 378384 [details]
Patch
Comment 2 Simon Fraser (smfr) 2019-09-09 11:20:10 PDT
Comment on attachment 378384 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=378384&action=review

> Websites/browserbench.org/MotionMark1.1/tests/3d/resources/webgpu.js:66
> +struct VertexOutput {
> +  float4 position : SV_Position;
> +  float4 color : attribute(1);
> +}
> +
> +vertex VertexOutput vertexMain(float4 position : attribute(0),
> +                                float4 color : attribute(1),
> +                                constant float[] timeUniform : register(b0, space0),
> +                                constant float[] uniforms : register(b0, space1)) {
> +  float scale = uniforms[0];
> +  float offsetX = uniforms[1];
> +  float offsetY = uniforms[2];
> +  float scalar = uniforms[3];
> +  float scalarOffset = uniforms[4];
> +  float time = timeUniform[0];
> +
> +  float fade = fmod(scalarOffset + time * scalar / 10.0, 1.0);
> +  if (fade < 0.5) {
> +      fade = fade * 2.0;
> +  } else {
> +      fade = (1.0 - fade) * 2.0;
> +  }
> +  float xpos = position.x * scale;
> +  float ypos = position.y * scale;
> +  float angle = 3.14159 * 2.0 * fade;
> +  float xrot = xpos * cos(angle) - ypos * sin(angle);
> +  float yrot = xpos * sin(angle) + ypos * cos(angle);
> +  xpos = xrot + offsetX;
> +  ypos = yrot + offsetY;
> +
> +  VertexOutput out;
> +  out.position = float4(xpos, ypos, 0.0, 1.0);
> +  out.color = float4(fade, 1.0 - fade, 0.0, 1.0) + color;
> +  return out;
> +}
> +
> +fragment float4 fragmentMain(float4 inColor : attribute(1)) : SV_Target 0 {
> +    return inColor;
> +}
> +`;

Should be 4-space indent.

> Websites/browserbench.org/MotionMark1.1/tests/3d/resources/webgpu.js:168
> +                    0, 0.1, 0, 1,     /**/ 1, 0, 0, 1,
> +                    -0.1, -0.1, 0, 1, /**/ 0, 1, 0, 1,
> +                    0.1, -0.1, 0, 1,  /**/ 0, 0, 1, 1,

I would line these up.

> Websites/browserbench.org/MotionMark1.1/tests/3d/triangles-webgl.html:78
> +#ifdef GL_ES
> +precision mediump float;
> +#endif

That's a thing?

> PerformanceTests/MotionMark/tests/3d/resources/webgpu.js:66
> +vertex VertexOutput vertexMain(float4 position : attribute(0),
> +                                float4 color : attribute(1),
> +                                constant float[] timeUniform : register(b0, space0),
> +                                constant float[] uniforms : register(b0, space1)) {
> +  float scale = uniforms[0];
> +  float offsetX = uniforms[1];
> +  float offsetY = uniforms[2];
> +  float scalar = uniforms[3];
> +  float scalarOffset = uniforms[4];
> +  float time = timeUniform[0];
> +
> +  float fade = fmod(scalarOffset + time * scalar / 10.0, 1.0);
> +  if (fade < 0.5) {
> +      fade = fade * 2.0;
> +  } else {
> +      fade = (1.0 - fade) * 2.0;
> +  }
> +  float xpos = position.x * scale;
> +  float ypos = position.y * scale;
> +  float angle = 3.14159 * 2.0 * fade;
> +  float xrot = xpos * cos(angle) - ypos * sin(angle);
> +  float yrot = xpos * sin(angle) + ypos * cos(angle);
> +  xpos = xrot + offsetX;
> +  ypos = yrot + offsetY;
> +
> +  VertexOutput out;
> +  out.position = float4(xpos, ypos, 0.0, 1.0);
> +  out.color = float4(fade, 1.0 - fade, 0.0, 1.0) + color;
> +  return out;
> +}
> +
> +fragment float4 fragmentMain(float4 inColor : attribute(1)) : SV_Target 0 {
> +    return inColor;
> +}
> +`;

Clean up indent

> PerformanceTests/MotionMark/tests/3d/resources/webgpu.js:168
> +                    0, 0.1, 0, 1,     /**/ 1, 0, 0, 1,
> +                    -0.1, -0.1, 0, 1, /**/ 0, 1, 0, 1,
> +                    0.1, -0.1, 0, 1,  /**/ 0, 0, 1, 1,

Ditto.
Comment 3 Jon Lee 2019-09-09 11:24:35 PDT
(In reply to Simon Fraser (smfr) from comment #2)
Thanks. I filed b201609 to address those comments.
Comment 4 WebKit Commit Bot 2019-09-09 12:30:56 PDT
Comment on attachment 378384 [details]
Patch

Clearing flags on attachment: 378384

Committed r249657: <https://trac.webkit.org/changeset/249657>
Comment 5 WebKit Commit Bot 2019-09-09 12:30:58 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-09-09 12:31:19 PDT
<rdar://problem/55193279>