Exemple #1
0
        /// <inheritdoc/>
        protected internal override void OnDestroyed()
        {
            if (ParentTexture != null || isNotOwningResources)
            {
                NativeImage  = SharpVulkan.Image.Null;
                NativeMemory = DeviceMemory.Null;
            }

            if (!isNotOwningResources)
            {
                if (NativeMemory != DeviceMemory.Null)
                {
                    GraphicsDevice.Collect(NativeMemory);
                    NativeMemory = DeviceMemory.Null;
                }

                if (NativeImage != SharpVulkan.Image.Null)
                {
                    GraphicsDevice.Collect(NativeImage);
                    NativeImage = SharpVulkan.Image.Null;
                }

                if (NativeBuffer != SharpVulkan.Buffer.Null)
                {
                    GraphicsDevice.Collect(NativeBuffer);
                    NativeBuffer = SharpVulkan.Buffer.Null;
                }

                if (NativeImageView != ImageView.Null)
                {
                    GraphicsDevice.Collect(NativeImageView);
                    NativeImageView = ImageView.Null;
                }

                if (NativeColorAttachmentView != ImageView.Null)
                {
                    GraphicsDevice.Collect(NativeColorAttachmentView);
                    NativeColorAttachmentView = ImageView.Null;
                }

                if (NativeDepthStencilView != ImageView.Null)
                {
                    GraphicsDevice.Collect(NativeDepthStencilView);
                    NativeDepthStencilView = ImageView.Null;
                }
            }

            base.OnDestroyed();
        }
Exemple #2
0
        /// <inheritdoc/>
        protected internal override void OnDestroyed()
        {
            GraphicsDevice.BuffersMemory -= SizeInBytes / (float)0x100000;

            if (NativeBufferView != BufferView.Null)
            {
                GraphicsDevice.Collect(NativeBufferView);
                NativeBufferView = BufferView.Null;
            }

            if (NativeBuffer != SharpVulkan.Buffer.Null)
            {
                GraphicsDevice.Collect(NativeBuffer);
                NativeBuffer = SharpVulkan.Buffer.Null;
            }

            if (NativeMemory != DeviceMemory.Null)
            {
                GraphicsDevice.Collect(NativeMemory);
                NativeMemory = DeviceMemory.Null;
            }

            base.OnDestroyed();
        }
Exemple #3
0
        /// <inheritdoc/>
        protected internal override void OnDestroyed()
        {
            GraphicsDevice.RegisterBufferMemoryUsage(-SizeInBytes);

            if (NativeBufferView != BufferView.Null)
            {
                GraphicsDevice.Collect(NativeBufferView);
                NativeBufferView = BufferView.Null;
            }

            if (NativeBuffer != SharpVulkan.Buffer.Null)
            {
                GraphicsDevice.Collect(NativeBuffer);
                NativeBuffer = SharpVulkan.Buffer.Null;
            }

            if (NativeMemory != DeviceMemory.Null)
            {
                GraphicsDevice.Collect(NativeMemory);
                NativeMemory = DeviceMemory.Null;
            }

            base.OnDestroyed();
        }