Exemplo n.º 1
0
        private void DrawUnsupportedShaders()
        {
#if UNITY_EDITOR
            if (errorMaterial == null)
            {
                errorMaterial = new Material(Shader.Find("Hidden/InternalErrorShader"));
            }
            DrawingSettings drawingSettings = new DrawingSettings(legacyShaderTagIds[0], new SortingSettings(m_cam))
            {
                overrideMaterial = errorMaterial
            };
            FilteringSettings filteringSettings = FilteringSettings.defaultValue;
            for (int i = 1; i < legacyShaderTagIds.Length; i++)
            {
                drawingSettings.SetShaderPassName(i, legacyShaderTagIds[i]);
            }
            m_context.DrawRenderers(m_CullingResults, ref drawingSettings, ref filteringSettings);
#endif
        }
 public void DrawRenderers(CullingResults cullingResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings)
 {
     Validate();
     cullingResults.Validate();
     DrawRenderers_Internal(cullingResults.ptr, ref drawingSettings, ref filteringSettings, IntPtr.Zero, IntPtr.Zero, 0);
 }
 extern private unsafe RendererList CreateRendererList_Internal(IntPtr cullResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings, ShaderTagId tagName, bool isPassTagName, IntPtr tagValues, IntPtr stateBlocks, int stateCount);
        public unsafe void DrawRenderers(CullingResults cullingResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings, ref RenderStateBlock stateBlock)
        {
            Validate();
            cullingResults.Validate();
            var renderType = new ShaderTagId();

            fixed(RenderStateBlock *stateBlockPtr = &stateBlock)
            {
                DrawRenderers_Internal(cullingResults.ptr, ref drawingSettings, ref filteringSettings, (IntPtr)(&renderType), (IntPtr)stateBlockPtr, 1);
            }
        }
 public unsafe void DrawRenderers(CullingResults cullingResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings, NativeArray <ShaderTagId> renderTypes, NativeArray <RenderStateBlock> stateBlocks)
 {
     Validate();
     cullingResults.Validate();
     if (renderTypes.Length != stateBlocks.Length)
     {
         throw new ArgumentException($"Arrays {nameof(renderTypes)} and {nameof(stateBlocks)} should have same length, but {nameof(renderTypes)} had length {renderTypes.Length} while {nameof(stateBlocks)} had length {stateBlocks.Length}.");
     }
     DrawRenderers_Internal(cullingResults.ptr, ref drawingSettings, ref filteringSettings, (IntPtr)renderTypes.GetUnsafeReadOnlyPtr(), (IntPtr)stateBlocks.GetUnsafeReadOnlyPtr(), renderTypes.Length);
 }
 public RendererListParams(CullingResults cullingResults, DrawingSettings drawSettings, FilteringSettings filteringSettings)
 {
     this.cullingResults    = cullingResults;
     this.drawSettings      = drawSettings;
     this.filteringSettings = filteringSettings;
     tagName       = ShaderTagId.none;
     isPassTagName = false;
     tagValues     = null;
     stateBlocks   = null;
 }
 extern private unsafe void DrawRenderers_Internal(IntPtr cullResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings, IntPtr renderTypes, IntPtr stateBlocks, int stateCount);
 private void DrawRenderers_Internal(IntPtr cullResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings, ShaderTagId tagName, bool isPassTagName, IntPtr tagValues, IntPtr stateBlocks, int stateCount)
 {
     ScriptableRenderContext.DrawRenderers_Internal_Injected(ref this, cullResults, ref drawingSettings, ref filteringSettings, ref tagName, isPassTagName, tagValues, stateBlocks, stateCount);
 }
 private static extern void DrawRenderers_Internal_Injected(ref ScriptableRenderContext _unity_self, IntPtr cullResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings, ref ShaderTagId tagName, bool isPassTagName, IntPtr tagValues, IntPtr stateBlocks, int stateCount);
        public void DrawRenderers(CullingResults cullingResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings, ShaderTagId tagName, bool isPassTagName, NativeArray <ShaderTagId> tagValues, NativeArray <RenderStateBlock> stateBlocks)
        {
            this.Validate();
            cullingResults.Validate();
            bool flag = tagValues.Length != stateBlocks.Length;

            if (flag)
            {
                throw new ArgumentException(string.Format("Arrays {0} and {1} should have same length, but {2} had length {3} while {4} had length {5}.", new object[]
                {
                    "tagValues",
                    "stateBlocks",
                    "tagValues",
                    tagValues.Length,
                    "stateBlocks",
                    stateBlocks.Length
                }));
            }
            this.DrawRenderers_Internal(cullingResults.ptr, ref drawingSettings, ref filteringSettings, tagName, isPassTagName, (IntPtr)tagValues.GetUnsafeReadOnlyPtr <ShaderTagId>(), (IntPtr)stateBlocks.GetUnsafeReadOnlyPtr <RenderStateBlock>(), tagValues.Length);
        }
        public unsafe void DrawRenderers(CullingResults cullingResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings, ref RenderStateBlock stateBlock)
        {
            this.Validate();
            cullingResults.Validate();
            ShaderTagId shaderTagId = default(ShaderTagId);

            fixed(RenderStateBlock *ptr = &stateBlock)
            {
                RenderStateBlock *value = ptr;

                this.DrawRenderers_Internal(cullingResults.ptr, ref drawingSettings, ref filteringSettings, ShaderTagId.none, false, (IntPtr)((void *)(&shaderTagId)), (IntPtr)((void *)value), 1);
            }
        }
 public void DrawRenderers(CullingResults cullingResults, ref DrawingSettings drawingSettings, ref FilteringSettings filteringSettings)
 {
     this.Validate();
     cullingResults.Validate();
     this.DrawRenderers_Internal(cullingResults.ptr, ref drawingSettings, ref filteringSettings, ShaderTagId.none, false, IntPtr.Zero, IntPtr.Zero, 0);
 }