Closed Bug 1631168 Opened 5 years ago Closed 5 years ago

SWGL has many compilation warnings under GCC

Categories

(Core :: Graphics: WebRender, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: jimb, Assigned: jimb)

Details

Attachments

(3 files)

Compiling SWGL under GCC emits enough warnings to fill my terminal buffer, which is a minor annoyance during development.

When the software feature is enabled, a clause gets added to two match
statements, causing Rust to complain that another match clause is unreachable.
This patch makes the other match clause conditional on the absence of the
software feature.

Assignee: nobody → jimb
Status: NEW → ASSIGNED

Provide an explicit copy constructor for the GCC VectorType polyfill. Since
VectorType has an assignment operator, GCC is uncomfortable faking a copy
constructor, so we have to provide one.

Make VectorType default constructor actually initialize the elements. When we
have a GLSL if whose condition varies from fragment to fragment, and whose
alternatives either assign to a variable or discard the fragment, we compile the
assignment to an if_then_else call that preserves the old elements for
fragments not taking the assignment's path. But if this is the initializing
assignment, the 'old value' operand to that if_then_else is uninitialized. We
could make the translator smarter about this, and have it not use predicated
assignment in such cases, but this fix is fine for now.

Make VectorType::wrap take its argument by const reference, to avoid weird ABI
'notes'.

Depends on D71443

Add UNUSED marker to gl.cc function arguments.

Add GCC pragmas to ignore -Wunused-parameter and -Wunused-but-set-variable
warnings in the generated shaders. Since these are generated from GLSL, it is
hard to avoid the warnings by changing the code itself.

Avoid uninitialized values in vec4::operator[].

Depends on D71444

Pushed by jblandy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0ff89c708ad7 Address wrench build warnings with 'software' feature enabled. r=lsalzman
Pushed by jblandy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef53eeea8602 Address GCC warnings in gfx/wr/swgl/src/vector_type.h. r=lsalzman
Pushed by jblandy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4cd8258082d7 Address GCC warnings in SWGL. r=lsalzman
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: