Skip to content

Commit d0fb151

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

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

Graphics/ShaderTools/include/DXCompiler.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,18 @@ class IDXCompiler
5757
public:
5858
virtual ~IDXCompiler() {}
5959

60+
/// Returns the maximum shader model supported by the compiler.
6061
virtual ShaderVersion GetMaxShaderModel() = 0;
6162

63+
/// Returns true if the compiler is loaded and ready to use.
6264
virtual bool IsLoaded() = 0;
6365

66+
/// Returns the compiler version.
6467
virtual Version GetVersion() = 0;
6568

69+
/// Returns the name of the DX Compiler library.
70+
virtual const std::string& GetLibraryName() const = 0;
71+
6672
struct CompileAttribs
6773
{
6874
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
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)