Beispiel #1
0
        /// <summary>
        /// Populate the base data accesible via Texture, exludes pixel data and depth
        /// </summary>
        /// <param name="texture"></param>
        /// <param name="texdata"></param>
        /// <returns></returns>

        public static bool PopulateImageData(Texture texture, ref ImageData texdata)
        {
            texdata.id          = texture.GetInstanceID();
            texdata.format      = Vulkan.vkFormatForGraphicsFormat(texture.graphicsFormat);
            texdata.width       = texture.width;
            texdata.height      = texture.height;
            texdata.anisoLevel  = texture.anisoLevel;
            texdata.wrapMode    = Vulkan.vkSamplerAddressModeForWrapMode(texture.wrapMode);
            texdata.filterMode  = Vulkan.vkFilterForFilterMode(texture.filterMode);
            texdata.mipmapMode  = Vulkan.vkSamplerMipmapModeForFilterMode(texture.filterMode);
            texdata.mipmapCount = 1;
            texdata.mipmapBias  = 0.0f;
            return(true);
        }
Beispiel #2
0
        public static TextureSupportIssues GetSupportIssuesForTexture(Texture texture)
        {
            TextureSupportIssues issues = TextureSupportIssues.None;

            if (!texture.isReadable)
            {
                issues |= TextureSupportIssues.ReadWrite;
            }

            VkFormat format = Vulkan.vkFormatForGraphicsFormat(texture.graphicsFormat);

            if (format == VkFormat.UNDEFINED)
            {
                issues |= TextureSupportIssues.Format;
            }

            if (texture.dimension != TextureDimension.Tex2D && texture.dimension != TextureDimension.Tex2DArray)
            {
                issues |= TextureSupportIssues.Dimensions;                                                                                                  //&& texture.dimension != TextureDimension.Tex3D
            }
            return(issues);
        }