Exemplo n.º 1
0
        private void AppendInputAssemblerStatistics(FetchFrameInfo frameInfo)
        {
            FetchFrameIndexBindStats totalIndexStats = new FetchFrameIndexBindStats();

            {
                FetchFrameIndexBindStats indices = frameInfo.stats.indices;

                totalIndexStats.calls += indices.calls;
                totalIndexStats.sets  += indices.sets;
                totalIndexStats.nulls += indices.nulls;
            }

            FetchFrameLayoutBindStats totalLayoutStats = new FetchFrameLayoutBindStats();

            {
                FetchFrameLayoutBindStats layouts = frameInfo.stats.layouts;

                totalLayoutStats.calls += layouts.calls;
                totalLayoutStats.sets  += layouts.sets;
                totalLayoutStats.nulls += layouts.nulls;
            }

            // #mivance see AppendConstantBindStatistics
            FetchFrameVertexBindStats template         = frameInfo.stats.vertices;
            FetchFrameVertexBindStats totalVertexStats = new FetchFrameVertexBindStats();

            totalVertexStats.bindslots = new UInt32[template.bindslots.Length];

            {
                FetchFrameVertexBindStats vertices = frameInfo.stats.vertices;

                totalVertexStats.calls += vertices.calls;
                totalVertexStats.sets  += vertices.sets;
                totalVertexStats.nulls += vertices.nulls;

                System.Diagnostics.Debug.Assert(totalVertexStats.bindslots.Length == vertices.bindslots.Length);
                for (var s = 0; s < vertices.bindslots.Length; s++)
                {
                    totalVertexStats.bindslots[s] += vertices.bindslots[s];
                }
            }

            statisticsLog.AppendText("\n*** Input Assembler Statistics ***\n\n");

            statisticsLog.AppendText(String.Format("Total index calls: {0}, non-null index sets: {1}, null index sets: {2}\n", totalIndexStats.calls, totalIndexStats.sets, totalIndexStats.nulls));
            statisticsLog.AppendText(String.Format("Total layout calls: {0}, non-null layout sets: {1}, null layout sets: {2}\n", totalLayoutStats.calls, totalLayoutStats.sets, totalLayoutStats.nulls));
            statisticsLog.AppendText(String.Format("Total vertex calls: {0}, non-null vertex sets: {1}, null vertex sets: {2}\n", totalVertexStats.calls, totalVertexStats.sets, totalVertexStats.nulls));

            statisticsLog.AppendText(CreateSimpleIntegerHistogram("Aggregate vertex slot counts per invocation", totalVertexStats.bindslots));
        }
Exemplo n.º 2
0
        private void AppendInputAssemblerStatistics(FetchFrameInfo[] frameList)
        {
            FetchFrameIndexBindStats totalIndexStats = new FetchFrameIndexBindStats();

            foreach (var f in frameList)
            {
                FetchFrameIndexBindStats indices = f.stats.indices;

                totalIndexStats.calls += indices.calls;
                totalIndexStats.sets  += indices.sets;
                totalIndexStats.nulls += indices.nulls;
            }

            FetchFrameLayoutBindStats totalLayoutStats = new FetchFrameLayoutBindStats();

            foreach (var f in frameList)
            {
                FetchFrameLayoutBindStats layouts = f.stats.layouts;

                totalLayoutStats.calls += layouts.calls;
                totalLayoutStats.sets  += layouts.sets;
                totalLayoutStats.nulls += layouts.nulls;
            }

            // #mivance see AppendConstantBindStatistics
            FetchFrameVertexBindStats template         = frameList[0].stats.vertices;
            FetchFrameVertexBindStats totalVertexStats = new FetchFrameVertexBindStats();

            totalVertexStats.slots = new UInt32[template.slots.Length];

            foreach (var f in frameList)
            {
                FetchFrameVertexBindStats vertices = f.stats.vertices;

                totalVertexStats.calls += vertices.calls;
                totalVertexStats.sets  += vertices.sets;
                totalVertexStats.nulls += vertices.nulls;

                System.Diagnostics.Debug.Assert(totalVertexStats.slots.Length == vertices.slots.Length);
                for (var s = 0; s < vertices.slots.Length; s++)
                {
                    totalVertexStats.slots[s] += vertices.slots[s];
                }
            }

            statisticsLog.AppendText("\n*** Input Assembler Statistics ***\n\n");

            statisticsLog.AppendText(String.Format("Total index calls: {0}, non-null index sets: {1}, null index sets: {2}\n", totalIndexStats.calls, totalIndexStats.sets, totalIndexStats.nulls));
            statisticsLog.AppendText(String.Format("Total layout calls: {0}, non-null layout sets: {1}, null layout sets: {2}\n", totalLayoutStats.calls, totalLayoutStats.sets, totalLayoutStats.nulls));
            statisticsLog.AppendText(String.Format("Total vertex calls: {0}, non-null vertex sets: {1}, null vertex sets: {2}\n", totalVertexStats.calls, totalVertexStats.sets, totalVertexStats.nulls));

            statisticsLog.AppendText("\nHistogram of aggregate vertex slot counts per invocation:\n");
            UInt32 maxCount     = 0;
            int    maxWithValue = 0;

            for (var s = 1; s < totalVertexStats.slots.Length; s++)
            {
                UInt32 value = totalVertexStats.slots[s];
                if (value > 0)
                {
                    maxWithValue = s;
                }
                maxCount = Math.Max(maxCount, value);
            }

            for (var s = 1; s <= maxWithValue; s++)
            {
                UInt32 count = totalVertexStats.slots[s];
                int    slice = SliceForString(Stars, count, maxCount);
                statisticsLog.AppendText(String.Format("{0,2}: {1} {2}\n", s, Stars.Substring(0, slice), CountOrEmpty(count)));
            }
        }