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; }
// 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(); }
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; }