summaryrefslogtreecommitdiffstats
path: root/examples/example-base/test-base.h
blob: 2705baa26b721a1a1e7c3548043627089f786271 (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
#pragma once

#include "core/slang-string-util.h"
#include "slang-com-ptr.h"
#include "slang-rhi.h"
#include "slang.h"

using Slang::ComPtr;

class TestBase
{

public:
    // Parses command line options including help, API selection, and test mode.
    int parseOption(int argc, char** argv);

    void printEntrypointHashes(
        int entryPointCount,
        int targetCount,
        ComPtr<slang::IComponentType>& composedProgram);

    bool isTestMode() const { return m_isTestMode; }
    bool shouldShowHelp() const { return m_showHelp; }
    rhi::DeviceType getDeviceType() const { return m_deviceType; }

    void printUsage(const char* programName) const;

private:
    bool m_isTestMode = false;
    bool m_showHelp = false;
    rhi::DeviceType m_deviceType = rhi::DeviceType::Default;
    uint64_t m_globalCounter = 0;
};