Skip to content

Commit a4ce36e

Browse files
committed
fixup some IShaderCompiler::SOptions
1 parent bead034 commit a4ce36e

File tree

4 files changed

+15
-26
lines changed

4 files changed

+15
-26
lines changed

include/nbl/asset/utils/CGLSLCompiler.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ class NBL_API2 CGLSLCompiler final : public IShaderCompiler
2020

2121
struct SOptions : IShaderCompiler::SOptions
2222
{
23-
void setCommonData(const IShaderCompiler::SOptions& opt)
24-
{
25-
static_cast<IShaderCompiler::SOptions&>(*this) = opt;
26-
}
27-
28-
virtual IShader::E_CONTENT_TYPE getCodeContentType() const override { return IShader::E_CONTENT_TYPE::ECT_GLSL; };
23+
IShader::E_CONTENT_TYPE getCodeContentType() const override { return IShader::E_CONTENT_TYPE::ECT_GLSL; };
2924
};
3025

3126
/**

include/nbl/asset/utils/CHLSLCompiler.h

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@ class NBL_API2 CHLSLCompiler final : public IShaderCompiler
2121
struct SOptions : IShaderCompiler::SOptions
2222
{
2323
// TODO: Add extra dxc options
24-
25-
void setCommonData(const IShaderCompiler::SOptions& opt)
26-
{
27-
static_cast<IShaderCompiler::SOptions&>(*this) = opt;
28-
}
29-
30-
virtual IShader::E_CONTENT_TYPE getCodeContentType() const override { return IShader::E_CONTENT_TYPE::ECT_HLSL; };
24+
IShader::E_CONTENT_TYPE getCodeContentType() const override { return IShader::E_CONTENT_TYPE::ECT_HLSL; };
3125
};
3226

3327
core::smart_refctd_ptr<ICPUBuffer> compileToSPIRV(const char* code, const CHLSLCompiler::SOptions& options) const;
@@ -36,22 +30,17 @@ class NBL_API2 CHLSLCompiler final : public IShaderCompiler
3630

3731
core::smart_refctd_ptr<ICPUShader> createSPIRVShader(system::IFile* sourceFile, const CHLSLCompiler::SOptions& options) const;
3832

39-
/*
40-
If original code contains #version specifier,
41-
then the filled fmt will be placed onto the next line after #version in the output buffer. If not, fmt will be placed into the
42-
beginning of the output buffer.
43-
*/
4433
template<typename... Args>
4534
static core::smart_refctd_ptr<ICPUShader> createOverridenCopy(const ICPUShader* original, const char* fmt, Args... args)
4635
{
4736
return IShaderCompiler::createOverridenCopy(original, 0u, fmt, args...);
4837
}
4938

50-
static inline const char* getStorageImageFormatQualifier(const asset::E_FORMAT format)
51-
{
52-
// TODO
53-
return "";
54-
}
39+
// TODO
40+
//static inline const char* getStorageImageFormatQualifier(const asset::E_FORMAT format)
41+
//{
42+
// return "";
43+
//}
5544
};
5645

5746
}

include/nbl/asset/utils/IShaderCompiler.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,20 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
124124
{
125125
IShader::E_SHADER_STAGE stage = IShader::E_SHADER_STAGE::ESS_UNKNOWN;
126126
E_SPIRV_VERSION targetSpirvVersion = E_SPIRV_VERSION::ESV_1_6;
127-
const char* entryPoint = nullptr;
128-
const char* sourceIdentifier = nullptr;
127+
std::string_view entryPoint = nullptr;
128+
std::string_view sourceIdentifier = nullptr;
129129
std::string* outAssembly = nullptr;
130130
const ISPIRVOptimizer* spirvOptimizer = nullptr;
131131
system::logger_opt_ptr logger = nullptr;
132132
const CIncludeFinder* includeFinder = nullptr;
133133
uint32_t maxSelfInclusionCount = 4u;
134134
bool genDebugInfo = true;
135135

136+
void setCommonData(const SOptions& opt)
137+
{
138+
(*this) = opt;
139+
}
140+
136141
virtual IShader::E_CONTENT_TYPE getCodeContentType() const { return IShader::E_CONTENT_TYPE::ECT_UNKNOWN; };
137142
};
138143

0 commit comments

Comments
 (0)