| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsVulkanPrerequisites.h"
- #include "BsVulkanResource.h"
- #include "RenderAPI/BsGpuProgram.h"
- namespace bs { namespace ct
- {
- /** @addtogroup Vulkan
- * @{
- */
- /** Wrapper around a Vulkan shader module (GPU program) that manages its usage and lifetime. */
- class VulkanShaderModule : public VulkanResource
- {
- public:
- VulkanShaderModule(VulkanResourceManager* owner, VkShaderModule module);
- ~VulkanShaderModule();
- /** Returns the internal handle to the Vulkan object. */
- VkShaderModule getHandle() const { return mModule; }
- private:
- VkShaderModule mModule;
- };
- /** Abstraction of a Vulkan shader object. */
- class VulkanGpuProgram : public GpuProgram
- {
- public:
- virtual ~VulkanGpuProgram();
- /**
- * Returns the shader module for the specified device. If program device mask doesn't include the provided device,
- * null is returned.
- */
- VulkanShaderModule* getShaderModule(UINT32 deviceIdx) const { return mModules[deviceIdx]; }
- protected:
- friend class VulkanGLSLProgramFactory;
- VulkanGpuProgram(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask);
- /** @copydoc GpuProgram::initialize */
- void initialize() override;
- private:
- GpuDeviceFlags mDeviceMask;
- VulkanShaderModule* mModules[BS_MAX_DEVICES];
- };
- /** @} */
- }}
|