Ejemplo n.º 1
0
 internal VkTexture(
     VkGraphicsDevice gd,
     uint width,
     uint height,
     uint mipLevels,
     uint arrayLayers,
     VkFormat vkFormat,
     TextureUsage usage,
     TextureSampleCount sampleCount,
     VkImage existingImage)
 {
     Debug.Assert(width > 0 && height > 0);
     _gd           = gd;
     MipLevels     = mipLevels;
     Width         = width;
     Height        = height;
     Depth         = 1;
     VkFormat      = vkFormat;
     Format        = VkFormats.VkToVdPixelFormat(VkFormat);
     ArrayLayers   = arrayLayers;
     Usage         = usage;
     SampleCount   = sampleCount;
     VkSampleCount = VkFormats.VdToVkSampleCount(sampleCount);
     _optimalImage = existingImage;
 }
Ejemplo n.º 2
0
        // Used to construct Swapchain textures.
        internal VkTexture(
            VkGraphicsDevice gd,
            uint width,
            uint height,
            uint mipLevels,
            uint arrayLayers,
            VkFormat vkFormat,
            TextureUsage usage,
            TextureSampleCount sampleCount,
            VkImage existingImage)
        {
            Debug.Assert(width > 0 && height > 0);
            _gd           = gd;
            MipLevels     = mipLevels;
            _width        = width;
            _height       = height;
            _depth        = 1;
            VkFormat      = vkFormat;
            _format       = VkFormats.VkToVdPixelFormat(VkFormat);
            ArrayLayers   = arrayLayers;
            Usage         = usage;
            Type          = TextureType.Texture2D;
            SampleCount   = sampleCount;
            VkSampleCount = VkFormats.VdToVkSampleCount(sampleCount);
            _optimalImage = existingImage;
            _imageLayouts = new[] { VkImageLayout.Undefined };

            ClearIfRenderTarget();
        }
Ejemplo n.º 3
0
 internal VkTexture(
     VkGraphicsDevice gd,
     uint width,
     uint height,
     uint mipLevels,
     uint arrayLayers,
     VkFormat vkFormat,
     TextureUsage usage,
     VkImage existingImage)
 {
     _gd         = gd;
     MipLevels   = mipLevels;
     Width       = width;
     Height      = height;
     Depth       = 1;
     VkFormat    = vkFormat;
     Format      = VkFormats.VkToVdPixelFormat(VkFormat);
     ArrayLayers = arrayLayers;
     Usage       = usage;
     _image      = existingImage;
 }