2#include "../foray_vulkan.hpp"
3#include "../osi/foray_env.hpp"
39 template <
size_t ARR_SIZE>
45 template <
size_t ARR_SIZE>
63 VkPipelineShaderStageCreateInfo
GetShaderStageCi(VkShaderStageFlagBits stage,
const char* entry =
"main")
const;
65 operator VkShaderModule()
const;
74 return LoadFromBinary(context, binaryBuffer.data(), binaryBuffer.size());
79 return LoadFromBinary(context, binaryBuffer.data(), binaryBuffer.size());
82 template <
size_t ARR_SIZE>
88 template <
size_t ARR_SIZE>
91 return LoadFromBinary(context, binaryBuffer, ARR_SIZE *
sizeof(uint32_t));
Wraps shader code driver handle (VkShaderModule). See ShaderManager for compiling shaders dynamically...
Definition foray_shadermodule.hpp:11
VkPipelineShaderStageCreateInfo GetShaderStageCi(VkShaderStageFlagBits stage, const char *entry="main") const
Fill a shader stage create info. .sType, .stage, .module, .pName fields are set, remainder default in...
~ShaderModule()
Definition foray_shadermodule.hpp:15
Context * mContext
Definition foray_shadermodule.hpp:68
VkShaderModule mShaderModule
Definition foray_shadermodule.hpp:69
void LoadFromBinary(Context *context, const uint8_t *binaryBuffer, size_t sizeInBytes)
Loads from a binary buffer.
uint64_t CompileFromSource(Context *context, const osi::Utf8Path &path, const ShaderCompilerConfig &config={})
Loads by compiling from source using the ShaderManager.
virtual bool Exists() const override
Return true, if the managed resource is allocated.
Definition foray_shadermodule.hpp:58
void LoadFromBinary(Context *context, const std::vector< uint8_t > &binaryBuffer)
Loads from a binary buffer.
Definition foray_shadermodule.hpp:72
void LoadFromBinary(Context *context, const uint32_t *binaryBuffer, size_t sizeInBytes)
Loads from a binary buffer.
virtual void Destroy() override
Destroy the resource.
void LoadFromFile(Context *context, const osi::Utf8Path &path)
Loads from a spirv file.
ManagedResource variant which automates GetTypeName() overloading by returning a stringified version ...
Definition foray_managedresource.hpp:59
Utf8 encoded path wrapper.
Definition foray_env.hpp:28
Definition foray_commandbuffer.hpp:6
Non owning context object.
Definition foray_context.hpp:16
Shader compile Options struct (moved out of class to fix clang & gcc compiler bug https://gcc....
Definition foray_shadermanager.hpp:13