CMSC23740 Common Code Library
Support code for CS23740 programming projects
Toggle main menu visibility
Loading...
Searching...
No Matches
shader.hpp
Go to the documentation of this file.
1
7
8
/*
9
* COPYRIGHT (c) 2026 John Reppy (https://cs.uchicago.edu/~jhr)
10
* All rights reserved.
11
*/
12
13
#ifndef _CS237_SHADER_HPP_
14
#define _CS237_SHADER_HPP_
15
16
#ifndef _CS237_HPP_
17
#error "cs237/shader.hpp should not be included directly"
18
#endif
19
20
namespace
cs237
{
21
24
//
25
class
Shaders
{
26
public
:
27
38
Shaders
(
39
vk::Device device,
40
std::string
const
&stem,
41
vk::ShaderStageFlags
stages
);
42
43
/* \brief load a pre-compiled shader program from the file system.
44
* \param device the logical device that will run the shaders
45
* \param files a vector of the shader file names; the order of the file
46
* names should be a subset of: vertex, tessellation control,
47
* tessellation evaluation, fragment, and compute.
48
* \param stages a bitmask spcifying the shader stages that form the program.
49
* The number of set bits should be equal to the number
50
* of elements in the `files` vector.
51
*/
52
Shaders
(
53
vk::Device device,
54
std::vector<std::string>
const
&files,
55
vk::ShaderStageFlags
stages
);
56
57
~Shaders
();
58
60
int
numStages
()
const
{
return
this->_stages.size(); }
61
63
std::vector<vk::PipelineShaderStageCreateInfo>
const
&
stages
()
const
64
{
65
return
this->_stages;
66
}
67
68
private
:
69
vk::Device _device;
70
std::vector<vk::PipelineShaderStageCreateInfo> _stages;
71
72
};
// Shaders
73
74
}
/* namespace cs237 */
75
76
#endif
/* !_CS237_SHADER_HPP_ */
cs237::Shaders::numStages
int numStages() const
return the number of shader stages in the pipeline
Definition
shader.hpp:60
cs237::Shaders::Shaders
Shaders(vk::Device device, std::string const &stem, vk::ShaderStageFlags stages)
load a pre-compiled shader program from the file system.
cs237::Shaders::stages
std::vector< vk::PipelineShaderStageCreateInfo > const & stages() const
return a pointer to the array of stage create infos
Definition
shader.hpp:63
cs237::Shaders::Shaders
Shaders(vk::Device device, std::vector< std::string > const &files, vk::ShaderStageFlags stages)
cs237::Shaders::~Shaders
~Shaders()
cs237
Definition
aabb.hpp:22
cs237-library
include
cs237
shader.hpp
Generated by
1.18.0