我想从片段着色器(例如,纹理和法线贴图)访问具有相同采样参数的多个纹理。此外,当采样器保持静止时,图像会频繁变化(假设纹理是视频)。我发现了关于如何完成的矛盾信息。Vulkan Cookbook 指出,在某些平台上使用组合图像采样器可能会带来性能优势,但这个 Reddit 回答指出组合图像采样器没有任何意义。
我的问题是:考虑到它使程序的逻辑更简单,是否有任何理由不使用单独的采样图像和一个采样器(用于两个图像)?
我一直在查看 vulkan-hpp 源代码,试图了解如何管理StructureChain
s。我发现这种看起来很奇怪的语法(用注释标记的行)与template
关键字作为成员类型的使用有关。此外,它后面是一个没有;
前面的函数调用。
template<typename X, typename Y, typename ...Z, typename Dispatch>
VULKAN_HPP_INLINE StructureChain<X, Y, Z...> PhysicalDevice::getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format, Dispatch const &d ) const VULKAN_HPP_NOEXCEPT
{
StructureChain<X, Y, Z...> structureChain;
VULKAN_HPP_NAMESPACE::FormatProperties2& formatProperties = structureChain.template get<VULKAN_HPP_NAMESPACE::FormatProperties2>(); //This line
d.vkGetPhysicalDeviceFormatProperties2( m_physicalDevice, static_cast<VkFormat>( format ), reinterpret_cast<VkFormatProperties2*>( &formatProperties ) );
return structureChain;
}
Run Code Online (Sandbox Code Playgroud)
谁能帮我弄清楚这行的意思?