Skip to content

[HDRP] Fix rendering when adding an incompatible platform to the project #6495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed the rt screen space shadows not using the correct asset for allocating the history buffers.
- Fixed the intensity of the sky being reduced signficantly even if there is no clouds (case 1388279).
- Fixed a crash with render graph viewer when render graph is not provided with an execution name.
- Fixed rendering in the editor when an incompatible API is added (case 1384634).

### Changed
- Converted most TGA textures files to TIF to reduce the size of HDRP material samples.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,12 +759,24 @@ internal static bool IsSupportedBuildTarget(UnityEditor.BuildTarget buildTarget)

internal static bool AreGraphicsAPIsSupported(UnityEditor.BuildTarget target, ref GraphicsDeviceType unsupportedGraphicDevice)
{
foreach (var graphicAPI in UnityEditor.PlayerSettings.GetGraphicsAPIs(target))
bool editor = false;
#if UNITY_EDITOR
editor = !UnityEditor.BuildPipeline.isBuildingPlayer;
#endif

if (editor) // In the editor we use the current graphics device instead of the list to avoid blocking the rendering if an invalid API is added but not enabled.
{
if (!HDUtils.IsSupportedGraphicDevice(graphicAPI))
return HDUtils.IsSupportedGraphicDevice(SystemInfo.graphicsDeviceType);
}
else
{
foreach (var graphicAPI in UnityEditor.PlayerSettings.GetGraphicsAPIs(target))
{
unsupportedGraphicDevice = graphicAPI;
return false;
if (!HDUtils.IsSupportedGraphicDevice(graphicAPI))
{
unsupportedGraphicDevice = graphicAPI;
return false;
}
}
}
return true;
Expand Down