MXVK Vulkan Framework 0.33.1
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
18 uint32_t localSizeX = 1;
19 uint32_t localSizeY = 1;
20 uint32_t localSizeZ = 1;
21 bool usesHistoryTexture = false;
22 bool usesSpectrumTexture = false;
24 };
25
26 /**
27 * @brief Load a SPIR-V file from disk.
28 * @param path Absolute or relative path to a .spv file.
29 * @return Raw bytes loaded from file.
30 * @throws mxvk::Exception when the file cannot be opened, is empty, or is not 4-byte aligned.
31 */
32 [[nodiscard]] std::vector<char> load_spv(const std::string &path);
33
34 /** @brief Inspect a SPIR-V entry point and compute local workgroup size. */
35 [[nodiscard]] ShaderModuleInfo inspect_spirv(const std::vector<char> &spv_bytes);
36
37 /**
38 * @brief Create a shader module from SPIR-V bytecode.
39 * @param device Logical Vulkan device used to create the module.
40 * @param spv_bytes SPIR-V bytecode payload.
41 * @return Created shader module handle.
42 * @throws mxvk::Exception when inputs are invalid or module creation fails.
43 */
44 [[nodiscard]] VkShaderModule create_shader_module(VkDevice device, const std::vector<char> &spv_bytes);
45} // 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.