Beispiel #1
0
        /// <summary>
        /// bind an existing image to this descriptor set
        /// </summary>
        /// <param name="key">the key for this descriptor set</param>
        /// <param name="binding">binding id for this descriptor set</param>
        /// <param name="image">image to bind with this descriptor set</param>
        /// <param name="imageView">image view to bind with this descriptor set</param>
        public virtual void BindImage(
            string key,
            int binding,
            API.Image image,
            API.ImageView imageView
            )
        {
            if (image == null)
            {
                return;
            }

            //un-used variables
            _handle[key].CommandBuffer[binding]  = null;
            _handle[key].StagingBuffers[binding] = null;

            _handle[key].Images[binding]     = image;
            _handle[key].ImageViews[binding] = imageView;
            _handle[key].Samplers[binding]   = new API.Sampler(
                _handle[key].Images[binding]
                );

            TransferImageAndUpdateDescriptorSet(key, binding);
            _imageNeedsTransfered = true;
        }