17#include <vsg/vk/Device.h>
18#include <vsg/vk/vk_buffer.h>
27 class VSG_DECLSPEC ShaderCompileSettings :
public Inherit<Object, ShaderCompileSettings>
30 ShaderCompileSettings();
31 ShaderCompileSettings(
const ShaderCompileSettings& rhs,
const CopyOp& copyop = {});
41 SPIRV_1_0 = (1 << 16),
42 SPIRV_1_1 = (1 << 16) | (1 << 8),
43 SPIRV_1_2 = (1 << 16) | (2 << 8),
44 SPIRV_1_3 = (1 << 16) | (3 << 8),
45 SPIRV_1_4 = (1 << 16) | (4 << 8),
46 SPIRV_1_5 = (1 << 16) | (5 << 8)
49 uint32_t vulkanVersion = VK_API_VERSION_1_0;
50 int clientInputVersion = 100;
51 Language language = GLSL;
52 int defaultVersion = 450;
53 SpirvTarget target = SPIRV_1_0;
54 bool forwardCompatible =
false;
55 bool generateDebugInfo =
false;
56 bool optimize =
false;
58 std::set<std::string> defines;
64 void read(
Input& input)
override;
65 void write(
Output& output)
const override;
71 class VSG_DECLSPEC ShaderModule :
public Inherit<Object, ShaderModule>
74 using SPIRV = std::vector<uint32_t>;
77 ShaderModule(
const ShaderModule& rhs,
const CopyOp& copyop = {});
79 explicit ShaderModule(
const SPIRV& in_code);
80 ShaderModule(
const std::string& source,
const SPIRV& in_code);
89 VkShaderModule
vk(uint32_t deviceID)
const {
return _implementation[deviceID]->_shaderModule; }
95 void release(uint32_t deviceID) { _implementation[deviceID] = {}; }
96 void release() { _implementation.clear(); }
102 void read(
Input& input)
override;
103 void write(
Output& output)
const override;
106 virtual ~ShaderModule();
108 struct Implementation :
public Inherit<Object, Implementation>
110 Implementation(
Device* device, ShaderModule* shader);
112 virtual ~Implementation();
114 VkShaderModule _shaderModule;
123 extern VSG_DECLSPEC std::string insertIncludes(
const std::string& source,
ref_ptr<const Options> options);
Device encapsulates VkDevice, a logical handle to the PhysicalDevice with capabilities specified duri...
Definition Device.h:39
Definition ShaderModule.h:28
ref_ptr< Object > clone(const CopyOp ©op={}) const override
Definition ShaderModule.h:61
int compare(const Object &rhs_object) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
Definition ShaderModule.h:72
VkShaderModule vk(uint32_t deviceID) const
Vulkan VkShaderModule handle.
Definition ShaderModule.h:89
ref_ptr< Object > clone(const CopyOp ©op={}) const override
Definition ShaderModule.h:99
SPIRV code
VkShaderModuleCreateInfo settings.
Definition ShaderModule.h:86
int compare(const Object &rhs_object) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
vk_buffer that manages a single logical device supported.
Definition vk_buffer.h:29