Closed Bug 1306172 Opened 4 years ago Closed 4 years ago

LINE_WIDTH > 1.0 is INVALID_VALUE in core profiles

Categories

(Core :: Canvas: WebGL, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox51 --- fixed
firefox52 --- fixed

People

(Reporter: jgilbert, Assigned: jgilbert)

References

Details

(Whiteboard: gfx-noted)

Attachments

(1 file)

No description provided.
Comment on attachment 8795964 [details]
Bug 1306172 - Don't pass LINE_WIDTH>1.0 to core profiles. -

https://reviewboard.mozilla.org/r/81940/#review80520

::: dom/canvas/WebGLContextGL.cpp:2413
(Diff revision 1)
>  {
>      if (IsContextLost())
>          return;
>  
>      // Doing it this way instead of `if (width <= 0.0)` handles NaNs.
>      const bool isValid = width > 0.0;

0.0f?

::: dom/canvas/WebGLContextGL.cpp:2421
(Diff revision 1)
>          return;
>      }
>  
> +    mLineWidth = width;
> +
> +    if (gl->IsCoreProfile() && width > 1.0) {

Please write down a comment to show why we need to do this.

Is it for the following spec?

https://www.opengl.org/registry/doc/glspec44.core.pdf
OpenGL 4.4 (Core Profile) - March 19, 2014
p.651 D.2.1
Wide lines - LineWidth values greater than 1.0 will generate an INVALID_VALUE error

::: dom/canvas/WebGLContextGL.cpp:2422
(Diff revision 1)
>      }
>  
> +    mLineWidth = width;
> +
> +    if (gl->IsCoreProfile() && width > 1.0) {
> +        width = 1.0;

How about compare with 1.0f instead of 1.0 (double)?

::: dom/canvas/WebGLContextValidate.cpp:675
(Diff revision 1)
>      mDepthClearValue = 1.f;
>      mStencilClearValue = 0;
>      mStencilRefFront = 0;
>      mStencilRefBack = 0;
>  
> +    mLineWidth = 1.0;

How about init with 1.0f for GLfloat?
Attachment #8795964 - Flags: review?(hshih) → review+
Blocks: 1306454
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0cc441ce2c8c
Don't pass LINE_WIDTH>1.0 to core profiles. - r=jerry
https://hg.mozilla.org/mozilla-central/rev/0cc441ce2c8c
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment on attachment 8795964 [details]
Bug 1306172 - Don't pass LINE_WIDTH>1.0 to core profiles. -

Approval Request Comment
[Feature/regressing bug #]: webgl2
[User impact if declined]:
[Describe test coverage new/current, TreeHerder]:
[Risks and why]: 
[String/UUID change made/needed]:
Attachment #8795964 - Flags: approval-mozilla-aurora?
Comment on attachment 8795964 [details]
Bug 1306172 - Don't pass LINE_WIDTH>1.0 to core profiles. -

WebGL 2 is the feature we want to ship in 51. Aurora51+.
Attachment #8795964 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.