SDEngine
Game Engine
Loading...
Searching...
No Matches
ShaderCompiler.cpp File Reference
#include "SD/core/ShaderCompiler.hpp"
#include <algorithm>
#include <cctype>
#include <string>
#include <string_view>
#include <vector>
#include <dxc/dxcapi.h>
#include "SD/core/logging.hpp"
#include "SD/utils/FixedString.hpp"
#include "SD/utils/utils.hpp"
#include <dxc/WinAdapter.h>
+ Include dependency graph for ShaderCompiler.cpp:

Classes

struct  ExtMapping
 

Namespaces

namespace  Microsoft
 
namespace  Microsoft::WRL
 
namespace  sd
 

Typedefs

template<typename T >
using Microsoft::WRL::ComPtr = CComPtr< T >
 
using ExtString = FixedString< 20 >
 

Functions

template<USize N>
consteval std::array< ExtString, Nconcatenate_mappings (std::array< ExtMapping, N > mappings)
 
template<USize N>
constexpr std::array< ExtMapping, Nsort_by_profile (std::array< ExtMapping, N > mappings)
 
std::wstring to_wstring (const std::string &str)
 
ComPtr< IDxcUtilsinit_dxc_utils ()
 
ComPtr< IDxcCompiler3init_dxc_compiler ()
 
std::string deduce_profile (std::string_view filename)
 
SD_EXPORT std::optional< std::vector< U32 > > sd::compile_shader (std::string_view filename, std::string_view profile={})
 

Variables

FILE_INTERNAL_BEGIN constexpr const chark_shader_model = "6_0"
 
constexpr std::array k_ext_to_profile
 
constexpr auto k_display_mappings = sort_by_profile(k_ext_to_profile)
 
constexpr std::array< ExtString, k_display_mappings.size()> k_display_exts
 

Typedef Documentation

◆ ExtString

Function Documentation

◆ concatenate_mappings()

template<USize N>
consteval std::array< ExtString, N > concatenate_mappings ( std::array< ExtMapping, N mappings)

◆ deduce_profile()

std::string deduce_profile ( std::string_view  filename)

◆ init_dxc_compiler()

ComPtr< IDxcCompiler3 > init_dxc_compiler ( )

◆ init_dxc_utils()

ComPtr< IDxcUtils > init_dxc_utils ( )

◆ sort_by_profile()

template<USize N>
constexpr std::array< ExtMapping, N > sort_by_profile ( std::array< ExtMapping, N mappings)
constexpr

◆ to_wstring()

std::wstring to_wstring ( const std::string str)

Variable Documentation

◆ k_display_exts

constexpr std::array<ExtString, k_display_mappings.size()> k_display_exts
constexpr
Initial value:
=
consteval std::array< ExtString, N > concatenate_mappings(std::array< ExtMapping, N > mappings)
Definition ShaderCompiler.cpp:76
constexpr auto k_display_mappings
Definition ShaderCompiler.cpp:98

◆ k_display_mappings

constexpr auto k_display_mappings = sort_by_profile(k_ext_to_profile)
constexpr

◆ k_ext_to_profile

constexpr std::array k_ext_to_profile
constexpr

◆ k_shader_model

FILE_INTERNAL_BEGIN constexpr const char* k_shader_model = "6_0"
constexpr