yum-mirror/slang

Making it easier to work with shaders

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

Jay KwakAdd command-line arguments to examples (#7835)13dd01489

master
834 B33 linesraw
1#pragma once
2
3#include "core/slang-string-util.h"
4#include "slang-com-ptr.h"
5#include "slang-rhi.h"
6#include "slang.h"
7
8using Slang::ComPtr;
9
10class TestBase
11{
12
13public:
14    // Parses command line options including help, API selection, and test mode.
15    int parseOption(int argc, char** argv);
16
17    void printEntrypointHashes(
18        int entryPointCount,
19        int targetCount,
20        ComPtr<slang::IComponentType>& composedProgram);
21
22    bool isTestMode() const { return m_isTestMode; }
23    bool shouldShowHelp() const { return m_showHelp; }
24    rhi::DeviceType getDeviceType() const { return m_deviceType; }
25
26    void printUsage(const char* programName) const;
27
28private:
29    bool m_isTestMode = false;
30    bool m_showHelp = false;
31    rhi::DeviceType m_deviceType = rhi::DeviceType::Default;
32    uint64_t m_globalCounter = 0;
33};