Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Implement utility to check for used render pipeline #766

Merged
merged 2 commits into from
Jan 23, 2021

Conversation

FejZa
Copy link
Contributor

@FejZa FejZa commented Jan 22, 2021

XRTK - Mixed Reality Toolkit Pull Request

Overview

Adds a small utility class to detect the render pipeline currently in use.

@FejZa FejZa self-assigned this Jan 22, 2021
@FejZa FejZa added the Ready for review PR finished primary development, open for review label Jan 22, 2021
@FejZa FejZa requested review from a team and SimonDarksideJ and removed request for a team January 22, 2021 20:15
Copy link
Contributor

@StephenHodgson StephenHodgson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments


switch (renderPipelineAsset.GetType().Name)
{
case urpAssetTypeName:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we can use pattern matching for the types instead of using the string name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual types are only available if the URP / HDRP package is installed and this check needs to work even when no render pipeline package is in use. So string is all we got.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FejZa do you know if those packages define symbols for the features?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No they don't. Freya Holmér put a lot of thoughts into this and this is pretty much what she came up with in the end. It's not perfect but I don't think currently there is any better way to check this.

Copy link
Contributor

@SimonDarksideJ SimonDarksideJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Did a bit of poking around and agree, it's the simplest solution since Unity doesn't provide an internal API

@FejZa FejZa merged commit 3fd1783 into development Jan 23, 2021
@FejZa FejZa deleted the feature/rp-utility branch January 23, 2021 13:44
XRTK-Build-Bot pushed a commit that referenced this pull request Jan 25, 2021
* Implement utility to check for used render pipeline

* Fix docs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ready for review PR finished primary development, open for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants