Support different material binding purposes based on current active display purposes

Problem Description

In the current OpenUSD implementation, a render delegate specifies its supported material via the GetMaterialBindingPurpose() function, which means only materials with a matching purpose are instantiated. An issue arises in usdview when attempting to switch the Display Purpose; alternate materials fail to render because they were not created in the first place.

I would first like to validate with the community whether this is the expected behaviour, a bug, or a missing feature.


Proposed Solution

I have devised a potential solution requiring minimal changes to the OpenUSD core and render delegate implementations (in case they want to support this feature).

The proposal involves introducing a new virtual function that allows a render delegate to return a vector of all supported material binding purposes. Hydra could then use this information to dynamically bind the appropriate material to each prim based on the currently active Display Purpose.