Hymn to Beauty
C++ 3D Engine
WebGPUShader.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../Interface/Shader.hpp"
4
5#include "WebGPU.hpp"
6#include <ShaderProcessor/ShaderSource.hpp>
7
8namespace Video {
9
11class WebGPUShader : public Shader {
12 public:
14
19 WebGPUShader(WGPUDevice device, const ShaderSource& shaderSource, Type type);
20
22 ~WebGPUShader() final;
23
25
28 const ShaderSource::ReflectionInfo& GetReflectionInfo() const;
29
31
34 WGPUShaderStage GetShaderStage() const;
35
37
40 WGPUShaderModule GetShaderModule() const;
41
42 private:
43 WebGPUShader(const WebGPUShader& other) = delete;
44
45 WGPUShaderModule shaderModule;
46 ShaderSource::ReflectionInfo reflectionInfo;
47 WGPUShaderStage shaderStage;
48};
49
50}
Compiles and handles a shader. Shaders should be linked together into a ShaderProgram.
Definition: Shader.hpp:8
Type
The type of shader.
Definition: Shader.hpp:11
WebGPU implementation of Shader.
Definition: WebGPUShader.hpp:11
~WebGPUShader() final
Destructor.
Definition: WebGPUShader.cpp:41
WebGPUShader(WGPUDevice device, const ShaderSource &shaderSource, Type type)
Create new WebGPU shader.
Definition: WebGPUShader.cpp:8
WGPUShaderStage GetShaderStage() const
Get the shader stage.
Definition: WebGPUShader.cpp:49
WGPUShaderModule GetShaderModule() const
Get the shader module.
Definition: WebGPUShader.cpp:53
const ShaderSource::ReflectionInfo & GetReflectionInfo() const
Get reflection info.
Definition: WebGPUShader.cpp:45
Definition: Editor.hpp:18