MXVK Vulkan Framework 0.24.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 <string>
4#include <vector>
5#include <volk/volk.h>
6
7namespace mxvk {
8 /**
9 * @brief Load a SPIR-V file from disk.
10 * @param path Absolute or relative path to a .spv file.
11 * @return Raw bytes loaded from file.
12 * @throws mxvk::Exception when the file cannot be opened, is empty, or is not 4-byte aligned.
13 */
14 [[nodiscard]] std::vector<char> load_spv(const std::string &path);
15
16 /**
17 * @brief Create a shader module from SPIR-V bytecode.
18 * @param device Logical Vulkan device used to create the module.
19 * @param spv_bytes SPIR-V bytecode payload.
20 * @return Created shader module handle.
21 * @throws mxvk::Exception when inputs are invalid or module creation fails.
22 */
23 [[nodiscard]] VkShaderModule create_shader_module(VkDevice device, const std::vector<char> &spv_bytes);
24} // namespace mxvk
Utilities for loading and saving PNG images.
Definition mxvk.hpp:30
VkShaderModule create_shader_module(VkDevice device, const std::vector< char > &spv_bytes)
Create a shader module from SPIR-V bytecode.
std::vector< char > load_spv(const std::string &path)
Load a SPIR-V file from disk.