[webkit-reviews] review granted: [Bug 201606] Upload triangles tests for 3D suite in MotionMark : [Attachment 378384] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 9 11:20:10 PDT 2019


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Jon Lee
<jonlee at apple.com>'s request for review:
Bug 201606: Upload triangles tests for 3D suite in MotionMark
https://bugs.webkit.org/show_bug.cgi?id=201606

Attachment 378384: Patch

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




--- Comment #2 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 378384
  --> https://bugs.webkit.org/attachment.cgi?id=378384
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.


More information about the webkit-reviews mailing list