Skip to content

Commit 59821a7

Browse files
IDXCompiler: added GetLibraryName() method
1 parent e7169bb commit 59821a7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

Graphics/ShaderTools/include/DXCompiler.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,22 @@ enum class DXCompilerTarget
5252
};
5353

5454
/// DXC compiler interface.
55-
class IDXCompiler
55+
struct IDXCompiler
5656
{
57-
public:
5857
virtual ~IDXCompiler() {}
5958

59+
/// Returns the maximum shader model supported by the compiler.
6060
virtual ShaderVersion GetMaxShaderModel() = 0;
6161

62+
/// Returns true if the compiler is loaded and ready to use.
6263
virtual bool IsLoaded() = 0;
6364

65+
/// Returns the compiler version.
6466
virtual Version GetVersion() = 0;
6567

68+
/// Returns the name of the DX Compiler library.
69+
virtual const std::string& GetLibraryName() const = 0;
70+
6671
struct CompileAttribs
6772
{
6873
const char* Source = nullptr;

Graphics/ShaderTools/include/DXCompilerLibrary.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Diligent Graphics LLC
2+
* Copyright 2024-2025 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -100,6 +100,11 @@ class DXCompilerLibrary
100100
return m_MaxShaderModel;
101101
}
102102

103+
const std::string& GetLibName() const
104+
{
105+
return m_LibName;
106+
}
107+
103108
private:
104109
void Load();
105110
void Unload();

Graphics/ShaderTools/src/DXCompiler.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ class DXCompilerImpl final : public IDXCompiler
101101
return m_Library.GetVersion();
102102
}
103103

104+
virtual const std::string& GetLibraryName() const override final
105+
{
106+
return m_Library.GetLibName();
107+
}
108+
104109
bool Compile(const CompileAttribs& Attribs) override final;
105110

106111
virtual void Compile(const ShaderCreateInfo& ShaderCI,

0 commit comments

Comments
 (0)