summaryrefslogtreecommitdiffstats
path: root/tools/gfx/metal/metal-shader-program.h
blob: c92e432be8d0e187ae56a3df398f2fe3148962cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// metal-shader-program.h
#pragma once

#include "metal-base.h"
#include "metal-shader-object-layout.h"

namespace gfx
{

using namespace Slang;

namespace metal
{

class ShaderProgramImpl : public ShaderProgramBase
{
public:
    DeviceImpl* m_device;
    RefPtr<RootShaderObjectLayoutImpl> m_rootObjectLayout;

    struct Module
    {
        SlangStage stage;
        String entryPointName;
        ComPtr<ISlangBlob> code;
        NS::SharedPtr<MTL::Library> library;
    };

    List<Module> m_modules;

    ShaderProgramImpl(DeviceImpl* device);
    ~ShaderProgramImpl();

    virtual Result createShaderModule(
        slang::EntryPointReflection* entryPointInfo,
        List<ComPtr<ISlangBlob>>& kernelCodes) override;
};


} // namespace metal
} // namespace gfx