Skip to content

[Impeller] Dump precision information in ShaderStageIOSlot for static interface matching. #147078

@chinmaygarde

Description

@chinmaygarde

On the PowerVR GE 8320 (and presumably all PowerVR devices), we discovered that mismatched RelaxedPrecision qualifiers in the shader stage IO slots would cause rendering issues. @jonahwilliams worked around the issue in flutter/engine#51974 but the issue is hard is to test and doesn't have a validation since the PowerVR behavior violates the behavior is the spec. about interface matching (see https://registry.khronos.org/vulkan/specs/1.3/html/vkspec.html#interfaces-iointerfaces-matching for the comment about RelaxedPrecision).

Since that patch has landed however, @gaaclarke has implemented static checking of shader interfaces in flutter/engine#52174. Mismatched stages should cause compilation errors now instead of runtime link error (or worse like in the case of PowerVR, graphical corruption).

The information about relaxed precision is a decoration that the compiler can dump in the ShaderStageIOSlot struct. Then the static asserts can be patched to check this extra field. That way, we should find any remaining instances of this issue (if any) and there will now be a hard check against introducing this bug (that is only ever caught on the PowerVR) in the future. This may come in handy as we try to squeeze the number of shaders and share more stages.

A test for this functionality would be that reverting @jonahwilliams earlier patch breaks the build now.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requeststeam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions