Closed Bug 1653544 Opened 3 months ago Closed 2 months ago

Generate comments with information about the shader during optimization

Categories

(Core :: Graphics: WebRender, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: nical, Assigned: nical)

Details

Attachments

(1 file)

The shader preprocessing used to emit a comment at the top with the name of the shader at build time, which was very handy when inspecting things in renderdoc or apitrace. It looks like the information got lost, I suspect during the shader optimization. It would be great to get that info back.

Icing on the cake would be to also show the shader feature defines.

(In reply to Nicolas Silva [:nical] from comment #0)

The shader preprocessing used to emit a comment at the top with the name of the shader at build time, which was very handy when inspecting things in renderdoc or apitrace. It looks like the information got lost, I suspect during the shader optimization. It would be great to get that info back.

Icing on the cake would be to also show the shader feature defines.

Can you just turn off shader optimization when running renderdoc/apitrace?

Flags: needinfo?(nical.bugzilla)

Here is where we write the optimized shader output to files.

I think basically we just need to
a) write the first line of the optimized shader (because GLSL requires the first line be the '#version' string)
b) write format!("// {}", full_shader_name)
c) write the rest of the optimized shader

Can you just turn off shader optimization when running renderdoc/apitrace?

Is it something I can do on a distributed nightly build ? In any case if I can help it I'd rather not have to think about fiddling around before capturing something.
The fix looks easy enough.

Flags: needinfo?(nical.bugzilla)

Setting gfx.webrender.use-optimized-shaders=false will make us use the non-optimized shaders, which might make debugging easier. (The optimized shaders can be quite hard to follow.)

This writes the shader name and list of featrues as a comment at the beginning of optimized shaders.

Assignee: nobody → nical.bugzilla
Status: NEW → ASSIGNED
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ce86a01c74be
Add usueful information in the generated shaders. r=jnicol
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.