1
- // TODO: Cypi
2
-
3
-
4
- // nsc input/simple_shader.hlsl -T ps_6_0 -E Main -Fo output/shader.ps
5
-
6
1
#include " nbl/system/IApplicationFramework.h"
7
-
8
2
#include < iostream>
9
3
#include < cstdlib>
10
4
#include < string>
@@ -35,9 +29,8 @@ class ShaderCompiler final : public system::IApplicationFramework
35
29
36
30
auto argc = argv.size ();
37
31
38
- // expect the first argument to be
39
- // .exe
40
- // second the filename of a shader to compile
32
+ // expect the first argument to be nsc.exe
33
+ // second argument should be input: filename of a shader to compile
41
34
if (argc < 2 ) {
42
35
m_logger->log (" Insufficient arguments." , ILogger::ELL_ERROR);
43
36
return false ;
@@ -110,15 +103,10 @@ class ShaderCompiler final : public system::IApplicationFramework
110
103
private:
111
104
112
105
core::smart_refctd_ptr<ICPUShader> compile_shader (const ICPUShader* shader, std::string_view sourceIdentifier) {
113
- constexpr uint32_t WorkgroupSize = 256 ;
114
- constexpr uint32_t WorkgroupCount = 2048 ;
115
- const string WorkgroupSizeAsStr = std::to_string (WorkgroupSize);
116
-
117
106
smart_refctd_ptr<CHLSLCompiler> hlslcompiler = make_smart_refctd_ptr<CHLSLCompiler>(smart_refctd_ptr (m_system));
118
107
119
108
CHLSLCompiler::SOptions options = {};
120
109
options.stage = shader->getStage ();
121
- // options.debugInfoFlags = IShaderCompiler::E_DEBUG_INFO_FLAGS::EDIF_LINE_BIT;
122
110
options.preprocessorOptions .sourceIdentifier = sourceIdentifier;
123
111
options.preprocessorOptions .logger = m_logger.get ();
124
112
options.dxcOptions = std::span<std::string>(m_arguments);
@@ -160,4 +148,4 @@ class ShaderCompiler final : public system::IApplicationFramework
160
148
161
149
};
162
150
163
- NBL_MAIN_FUNC (ShaderCompiler)
151
+ NBL_MAIN_FUNC (ShaderCompiler)
0 commit comments