浏览代码

Merge pull request #1288 from Unity-Technologies/Fix-issue-with-preprocessor

Fix issue with preprocessor
/main
GitHub 7 年前
当前提交
08b41047
共有 3 个文件被更改,包括 12 次插入0 次删除
  1. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPCustomBuildProcessor.cs
  2. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/BuildPlayer/HDRPVariantStripper.cs
  3. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/ShaderPreprocessor.cs

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


using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
class HDRPCustomBuildProcessor : IPreprocessBuildWithReport
{

{
// Don't execute the preprocess if we are not HDRenderPipeline
HDRenderPipeline hdrp = RenderPipelineManager.currentPipeline as HDRenderPipeline;
if (hdrp == null)
return;
// 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

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


public int callbackOrder { get { return 0; } }
public void OnProcessShader(Shader shader, ShaderSnippetData snippet, IList<ShaderCompilerData> inputData)
{
// This test will also return if we are not using HDRenderPipelineAsset
if (m_CurrentHDRPAsset == null || !m_CurrentHDRPAsset.allowShaderVariantStripping)
return;

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/ShaderPreprocessor.cs


public void OnProcessShader(Shader shader, ShaderSnippetData snippetData, IList<ShaderCompilerData> compilerDataList)
{
LightweightRP lw = RenderPipelineManager.currentPipeline as LightweightRP;
if (lw == null)
return;
PipelineCapabilities capabilities = LightweightRP.GetPipelineCapabilities();
int prevVariantCount = compilerDataList.Count;

正在加载...
取消
保存