yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Lujin WangChange SLANG_OVERRIDE_xxx_PATH and fix header file path (#7207)b16eb592c

master
741 B36 linesraw
1// glslang-module.h
2#pragma once
3
4#include "core/slang-list.h"
5#include "slang-com-helper.h"
6#include "slang-com-ptr.h"
7#include "slang-glslang/slang-glslang.h"
8#include "slang.h"
9#include "spirv-tools/include/spirv-tools/linker.hpp"
10
11namespace gfx
12{
13
14struct GlslangModule
15{
16    /// true if has been initialized
17    SLANG_FORCE_INLINE bool isInitialized() const { return m_module != nullptr; }
18
19    /// Initialize
20    Slang::Result init();
21
22    /// Destroy
23    void destroy();
24
25    /// Dtor
26    ~GlslangModule() { destroy(); }
27
28    Slang::ComPtr<ISlangBlob> linkSPIRV(Slang::List<Slang::ComPtr<ISlangBlob>> spirvModules);
29
30protected:
31    void* m_module = nullptr;
32
33    glslang_LinkSPIRVFunc m_linkSPIRVFunc = nullptr;
34};
35
36} // namespace gfx