Closed Bug 1816405 Opened 3 years ago Closed 3 years ago

Only print source of single shader when glslopt fails during build

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

Details

Attachments

(1 file)

If the glslopt pass fails to optimize a shader, we helpfully print the shader source so that it is easy to find what the problem is. However, we print this from within the build_parallel call, meaning if multiple shaders fail to optimize we print all of their sources and they get interleaved with each other, making it very difficult to find the problematic line.

Instead we should delay printing the source until the same place where we print the error log, after we have stopped processing in parallel. This means we will only print the source of a single shader (the first one which fails to optimize), along with the error log for that shader, which is much easier to debug.

If the glslopt pass fails to optimize a shader, we helpfully print the
shader source so that it is easy to find what the problem is. However,
we print this from within the build_parallel call, meaning if multiple
shaders fail to optimize we print all of their sources and they get
interleaved with each other, making it very difficult to find the
problematic line.

This patch makes us delay printing the source until the same place
where we print the error log, after we have stopped processing in
parallel. This means we will only print the source of a single
shader (the first one which fails to optimize), along with the error
log for that shader, which is much easier to debug.

This also includes a small tidy-up to handle both vertex and fragment
shaders in a loop to remove code duplication, and runs rustfmt.

Pushed by jnicol@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0bdba50a9ec8 Only print source of single shader when glslopt pass fails. r=gfx-reviewers,lsalzman
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: