Beispiel #1
0
        internal void TagResource(GraphicsResourceLink resourceLink)
        {
            switch (resourceLink.Resource)
            {
            case Texture texture:
                if (texture.Usage == GraphicsResourceUsage.Dynamic)
                {
                    // Increase the reference count until GPU is done with the resource
                    resourceLink.ReferenceCount++;
                    graphicsResourceLinkCollector.Add(NextFenceValue, resourceLink);
                }
                break;

            case Buffer buffer:
                if (buffer.Usage == GraphicsResourceUsage.Dynamic)
                {
                    // Increase the reference count until GPU is done with the resource
                    resourceLink.ReferenceCount++;
                    graphicsResourceLinkCollector.Add(NextFenceValue, resourceLink);
                }
                break;

            case QueryPool _:
                resourceLink.ReferenceCount++;
                graphicsResourceLinkCollector.Add(NextFenceValue, resourceLink);
                break;
            }
        }
        internal void TagResource(GraphicsResourceLink resourceLink)
        {
            var texture = resourceLink.Resource as Texture;

            if (texture != null && texture.Usage == GraphicsResourceUsage.Dynamic)
            {
                // Increase the reference count until GPU is done with the resource
                resourceLink.ReferenceCount++;
                graphicsResourceLinkCollector.Add(NextFenceValue, resourceLink);
            }

            var buffer = resourceLink.Resource as Buffer;

            if (buffer != null && buffer.Usage == GraphicsResourceUsage.Dynamic)
            {
                // Increase the reference count until GPU is done with the resource
                resourceLink.ReferenceCount++;
                graphicsResourceLinkCollector.Add(NextFenceValue, resourceLink);
            }
        }