// Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors. // All rights reserved. // Code licensed under the BSD License. // http://www.anki3d.org/LICENSE #pragma once #include #include #include #include namespace anki { /// @addtogroup vulkan /// @{ /// Shader vulkan implementation. class ShaderImpl final : public Shader, public VulkanObject { public: VkShaderModule m_handle = VK_NULL_HANDLE; Array, MAX_DESCRIPTOR_SETS> m_bindings; BitSet m_colorAttachmentWritemask = {false}; BitSet m_attributeMask = {false}; BitSet m_descriptorSetMask = {false}; Array, MAX_DESCRIPTOR_SETS> m_activeBindingMask = {{{false}, {false}}}; U32 m_pushConstantsSize = 0; ShaderImpl(GrManager* manager, CString name) : Shader(manager, name) { } ~ShaderImpl(); ANKI_USE_RESULT Error init(const ShaderInitInfo& init); const VkSpecializationInfo* getSpecConstInfo() const { return (m_specConstInfo.mapEntryCount) ? &m_specConstInfo : nullptr; } private: VkSpecializationInfo m_specConstInfo = {}; class SpecConstsVector; ///< Wrap this into a class to avoid forward declarations of std::vector and spirv_cross. void doReflection(ConstWeakArray spirv, SpecConstsVector& specConstIds); }; /// @} } // end namespace anki