浏览代码

HDRP: Add build processor to reject unsupported build

/main
sebastienlagarde 7 年前
当前提交
170e527c
共有 7 个文件被更改,包括 67 次插入14 次删除
  1. 30
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  2. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer.meta
  3. 32
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPCustomBuildProcessor.cs
  4. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPCustomBuildProcessor.cs.meta
  5. 0
      /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPVariantStripper.cs
  6. 0
      /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPVariantStripper.cs.meta

30
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


RTHandles.Release(m_DebugColorPickerBuffer);
RTHandles.Release(m_DebugFullScreenTempBuffer);
m_DebugScreenSpaceTracingData.Release();
HDCamera.CleanUnused();

bool IsSupportedPlatform()
{
// Note: If you add new platform in this function, think about adding support when building the player to in HDRPCustomBuildProcessor.cs
if (!SystemInfo.supportsComputeShaders)
return false;

{
cmd.SetGlobalTexture(HDShaderIDs._DepthPyramidTexture, previousDepthPyramidRT);
cmd.SetGlobalVector(HDShaderIDs._DepthPyramidSize, new Vector4(
previousDepthPyramidRT.referenceSize.x,
previousDepthPyramidRT.referenceSize.y,
1f / previousDepthPyramidRT.referenceSize.x,
previousDepthPyramidRT.referenceSize.x,
previousDepthPyramidRT.referenceSize.y,
1f / previousDepthPyramidRT.referenceSize.x,
previousDepthPyramidRT.referenceSize.x / (float)previousDepthPyramidRT.rt.width,
previousDepthPyramidRT.referenceSize.y / (float)previousDepthPyramidRT.rt.height,
Mathf.Log(Mathf.Min(previousDepthPyramidRT.rt.width, previousDepthPyramidRT.rt.height), 2),
previousDepthPyramidRT.referenceSize.x / (float)previousDepthPyramidRT.rt.width,
previousDepthPyramidRT.referenceSize.y / (float)previousDepthPyramidRT.rt.height,
Mathf.Log(Mathf.Min(previousDepthPyramidRT.rt.width, previousDepthPyramidRT.rt.height), 2),
previousColorPyramidRT.referenceSize.x,
previousColorPyramidRT.referenceSize.y,
1f / previousColorPyramidRT.referenceSize.x,
previousColorPyramidRT.referenceSize.x,
previousColorPyramidRT.referenceSize.y,
1f / previousColorPyramidRT.referenceSize.x,
previousColorPyramidRT.referenceSize.x / (float)previousColorPyramidRT.rt.width,
previousColorPyramidRT.referenceSize.y / (float)previousColorPyramidRT.rt.height,
Mathf.Log(Mathf.Min(previousColorPyramidRT.rt.width, previousColorPyramidRT.rt.height), 2),
previousColorPyramidRT.referenceSize.x / (float)previousColorPyramidRT.rt.width,
previousColorPyramidRT.referenceSize.y / (float)previousColorPyramidRT.rt.height,
Mathf.Log(Mathf.Min(previousColorPyramidRT.rt.width, previousColorPyramidRT.rt.height), 2),
0.0f
));
}

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer.meta


fileFormatVersion: 2
guid: fe988c96224a85949ae5a292c81d3d50
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

32
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPCustomBuildProcessor.cs


using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
class HDRPCustomBuildProcessor : IPreprocessBuildWithReport
{
public int callbackOrder { get { return 0; } }
public void OnPreprocessBuild(BuildReport report)
{
// Note: If you add new platform in this function, think about adding support in IsSupportedPlatform() function in HDRenderPipeline.cs
// If platform is supported all good
if (report.summary.platform == BuildTarget.StandaloneWindows ||
report.summary.platform == BuildTarget.StandaloneWindows64 ||
report.summary.platform == BuildTarget.StandaloneLinux64 ||
report.summary.platform == BuildTarget.StandaloneLinuxUniversal ||
report.summary.platform == BuildTarget.StandaloneOSX ||
report.summary.platform == BuildTarget.XboxOne ||
report.summary.platform == BuildTarget.PS4 /* ||
report.summary.platform == BuildTarget.Switch */)
{
return ;
}
string msg = "The platform " + report.summary.platform.ToString() + " is not supported with Hight Definition Render Pipeline";
// Throw an exception to stop the build
throw new BuildFailedException(msg);
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPCustomBuildProcessor.cs.meta


fileFormatVersion: 2
guid: 2ae263b0b434c7e4d9229fde8f6096c5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRPVariantStripper.cs → /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPVariantStripper.cs

/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRPVariantStripper.cs.meta → /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPVariantStripper.cs.meta

正在加载...
取消
保存