MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk_shader_module.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <vector>
6#include <volk/volk.h>
7
8namespace mxvk {
15
21
32
33 /**
34 * @brief Load a SPIR-V file from disk.
35 * @param path Absolute or relative path to a .spv file.
36 * @return Raw bytes loaded from file.
37 * @throws mxvk::Exception when the file cannot be opened, is empty, or is not 4-byte aligned.
38 */
39 [[nodiscard]] std::vector<char> load_spv(const std::string &path);
40
41 /** @brief Inspect a SPIR-V entry point and compute local workgroup size. */
42 [[nodiscard]] ShaderModuleInfo inspect_spirv(const std::vector<char> &spv_bytes);
43
44 /**
45 * @brief Create a shader module from SPIR-V bytecode.
46 * @param device Logical Vulkan device used to create the module.
47 * @param spv_bytes SPIR-V bytecode payload.
48 * @return Created shader module handle.
49 * @throws mxvk::Exception when inputs are invalid or module creation fails.
50 */
51 [[nodiscard]] VkShaderModule create_shader_module(VkDevice device, const std::vector<char> &spv_bytes);
52} // namespace mxvk
Utilities for loading and saving PNG images.
Definition mxvk.hpp:31
VkShaderModule create_shader_module(VkDevice device, const std::vector< char > &spv_bytes)
Create a shader module from SPIR-V bytecode.
ShaderModuleInfo inspect_spirv(const std::vector< char > &spv_bytes)
Inspect a SPIR-V entry point and compute local workgroup size.
std::vector< char > load_spv(const std::string &path)
Load a SPIR-V file from disk.
StorageImageFormat storageImageFormat