Ejemplo n.º 1
0
        public static VkSamplerCreateInfo.Raw MarshalDirect(this VkSamplerCreateInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            var pNext = s.Next.MarshalIndirect(ref unmanaged);

            VkSamplerCreateInfo.Raw result;
            result.sType                   = VkStructureType.SamplerCreateInfo;
            result.pNext                   = pNext;
            result.flags                   = s.Flags;
            result.magFilter               = s.MagFilter;
            result.minFilter               = s.MinFilter;
            result.mipmapMode              = s.MipmapMode;
            result.addressModeU            = s.AddressModeU;
            result.addressModeV            = s.AddressModeV;
            result.addressModeW            = s.AddressModeW;
            result.mipLodBias              = s.MipLodBias;
            result.anisotropyEnable        = new VkBool32(s.AnisotropyEnable);
            result.maxAnisotropy           = s.MaxAnisotropy;
            result.compareEnable           = new VkBool32(s.CompareEnable);
            result.compareOp               = s.CompareOp;
            result.minLod                  = s.MinLod;
            result.maxLod                  = s.MaxLod;
            result.borderColor             = s.BorderColor;
            result.unnormalizedCoordinates = new VkBool32(s.UnnormalizedCoordinates);
            return(result);
        }
Ejemplo n.º 2
0
        public static int SizeOfMarshalDirect(this VkSamplerCreateInfo s)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            return
                (s.Next.SizeOfMarshalIndirect());
        }
Ejemplo n.º 3
0
        public static VkSamplerCreateInfo.Raw *MarshalIndirect(this VkSamplerCreateInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                return((VkSamplerCreateInfo.Raw *) 0);
            }
            var result = (VkSamplerCreateInfo.Raw *)unmanaged;

            unmanaged += VkSamplerCreateInfo.Raw.SizeInBytes;
            *result = s.MarshalDirect(ref unmanaged);
            return(result);
        }
Ejemplo n.º 4
0
 public static int SizeOfMarshalIndirect(this VkSamplerCreateInfo s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkSamplerCreateInfo.Raw.SizeInBytes;