コード例 #1
0
ファイル: TimelineBar.cs プロジェクト: Anteru/renderdoc
 public void HighlightHistory(FetchTexture tex, Point pt, PixelModification[] modif)
 {
     m_HistoryTex = tex;
     m_HistoryPoint = pt;
     m_History = modif;
     panel.Invalidate();
 }
コード例 #2
0
ファイル: PixelHistoryView.cs プロジェクト: Anteru/renderdoc
        private string FailureString(PixelModification mod)
        {
            string s = "";

            if (mod.sampleMasked)
                s += "\nMasked by SampleMask";
            if (mod.backfaceCulled)
                s += "\nBackface culled";
            if (mod.depthClipped)
                s += "\nDepth Clipped";
            if (mod.scissorClipped)
                s += "\nScissor Clipped";
            if (mod.shaderDiscarded)
                s += "\nShader executed a discard";
            if (mod.depthTestFailed)
                s += "\nDepth test failed";
            if (mod.stencilTestFailed)
                s += "\nStencil test failed";

            return s;
        }
コード例 #3
0
ファイル: PixelHistoryView.cs プロジェクト: Anteru/renderdoc
        private TreelistView.Node MakeFragmentNode(PixelModification mod)
        {
            bool uintTex = (texture.format.compType == FormatComponentType.UInt);
            bool sintTex = (texture.format.compType == FormatComponentType.SInt);
            bool floatTex = (!uintTex && !sintTex);

            bool depth = false;

            if (texture.format.compType == FormatComponentType.Depth ||
                (texture.format.special && texture.format.specialFormat == SpecialFormat.D16S8) ||
                (texture.format.special && texture.format.specialFormat == SpecialFormat.D24S8) ||
                (texture.format.special && texture.format.specialFormat == SpecialFormat.D32S8) ||
                (texture.format.special && texture.format.specialFormat == SpecialFormat.S8))
                depth = true;

            TreelistView.Node node = null;

            if (mod.uavWrite)
            {
                string name = "Potential UAV/Copy write";

                string preModVal = "Tex Before\n\n" + ModificationValueString(mod.preMod, texture.format, depth);
                string postModVal = "Tex After\n\n" + ModificationValueString(mod.postMod, texture.format, depth);

                if (mod.preMod.col.value.u[0] == mod.postMod.col.value.u[0] &&
                    mod.preMod.col.value.u[1] == mod.postMod.col.value.u[1] &&
                    mod.preMod.col.value.u[2] == mod.postMod.col.value.u[2] &&
                    mod.preMod.col.value.u[3] == mod.postMod.col.value.u[3])
                {
                    name += "\nNo change in tex value";
                }

                node = new TreelistView.Node(new object[] { name, preModVal, "", postModVal, "" });
            }
            else
            {
                string name = String.Format("Primitive {0}\n", mod.primitiveID);

                if (mod.shaderDiscarded)
                    name += FailureString(mod);

                ResourceFormat fmt = new ResourceFormat(floatTex ? FormatComponentType.Float : texture.format.compType, 4, 4);

                string shadOutVal;
                string postModVal = "Tex After\n\n" + ModificationValueString(mod.postMod, texture.format, depth);

                if (mod.unboundPS)
                    shadOutVal = "No Pixel\nShader\nBound";
                else
                    shadOutVal = "Shader Out\n\n" + ModificationValueString(mod.shaderOut, fmt, depth);

                if (!mod.EventPassed() && hideFailedEventsToolStripMenuItem.Checked)
                    return null;

                node = new TreelistView.Node(new object[] { name, shadOutVal, "", postModVal, "" });

                if (mod.shaderDiscarded)
                    node.DefaultBackColor = Color.FromArgb(255, 235, 235);
            }

            node.Tag = new EventTag(mod.eventID, mod.uavWrite ? uint.MaxValue : mod.primitiveID);

            if (floatTex || depth)
            {
                node.IndexedBackColor[2] = ModificationValueColor(mod.shaderOut, depth);
                node.IndexedBackColor[4] = ModificationValueColor(mod.postMod, depth);
            }

            return node;
        }
コード例 #4
0
ファイル: PixelHistoryView.cs プロジェクト: Anteru/renderdoc
        public void SetHistory(PixelModification[] history)
        {
            modifications = history;

            UpdateEventList();

            PixelHistoryView_Enter(null, null);
        }