summaryrefslogtreecommitdiffstats
path: root/tools/render-test/options.h
blob: f416143602bc82cb2b69a20c61acba4ccc22afdd (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// options.h
#pragma once

#include <stdint.h>

#ifndef SLANG_HANDLE_RESULT_FAIL
#define SLANG_HANDLE_RESULT_FAIL(x) assert(!"failure")
#endif

#include "../../slang-com-helper.h"
#include "../../source/core/slang-writer.h"

#include "../../source/core/slang-process-util.h"

#include "../../source/compiler-core/slang-command-line-args.h"

#include "../../slang-gfx.h"

namespace renderer_test {

using namespace gfx;

struct Options
{
    enum class InputLanguageID
    {
        // Slang being used as an HLSL-ish compiler
        Slang,

        // Raw HLSL or GLSL input, bypassing Slang
        Native,
    };

    enum class ShaderProgramType
    {
        Graphics,
        Compute,
        GraphicsCompute,
        RayTracing,
    };

    Slang::String appName = "render-test";
    Slang::String sourcePath;
    Slang::String outputPath;
	ShaderProgramType shaderType = ShaderProgramType::Graphics;

        /// The renderer type inferred from the target language type. Used if a rendererType is not explicitly set.
    DeviceType targetLanguageDeviceType = DeviceType::Unknown;
        /// The set render type
    DeviceType deviceType = DeviceType::Unknown;
    InputLanguageID inputLanguageID = InputLanguageID::Slang;
    SlangSourceLanguage sourceLanguage = SLANG_SOURCE_LANGUAGE_UNKNOWN;

        /// Can be used for overriding the profile
    Slang::String profileName;

    bool outputUsingType = false;

    bool useDXIL = false;
    bool onlyStartup = false;

    bool performanceProfile = false;

    bool dontAddDefaultEntryPoints = false;

    Slang::List<Slang::String> renderFeatures;          /// Required render features for this test to run

    Slang::String adapter;                              ///< The adapter to use either name or index

    uint32_t computeDispatchSize[3] = { 1, 1, 1 };

    Slang::String nvapiExtnSlot;                               ///< The nvapiRegister to use.

    Slang::DownstreamArgs downstreamArgs;                    ///< Args to downstream tools. Here it's just slang

    bool generateSPIRVDirectly = false;

    Options() { downstreamArgs.addName("slang"); }

    static SlangResult parse(int argc, const char*const* argv, Slang::WriterHelper stdError, Options& outOptions);
};

} // renderer_test