mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-14 10:36:43 +00:00
Extend D3D12 GetShaderBlob() to allow passing arbitrary compile options
Pass via ShaderCompileFlag with name "@compile_option" and value is the compile option to add Added helper to return D3D12 Shader Cache m_CompileFlags
This commit is contained in:
@@ -495,6 +495,11 @@ rdcstr D3D12ShaderCache::GetShaderBlob(const char *source, const char *entry,
|
||||
uint32_t flags = DXBC::DecodeFlags(compileFlags) & ~D3DCOMPILE_NO_PRESHADER;
|
||||
rdcarray<rdcwstr> argsData;
|
||||
DXBC::EncodeDXCFlags(flags, argsData);
|
||||
for(const ShaderCompileFlag &flag : compileFlags.flags)
|
||||
{
|
||||
if(flag.name == "@compile_option")
|
||||
argsData.push_back(StringFormat::UTF82Wide(flag.value));
|
||||
}
|
||||
argsData.push_back(L"-select-validator internal");
|
||||
rdcarray<LPCWSTR> arguments;
|
||||
for(const rdcwstr &arg : argsData)
|
||||
|
||||
@@ -57,6 +57,8 @@ public:
|
||||
void LoadDXC();
|
||||
|
||||
void SetCaching(bool enabled) { m_CacheShaders = enabled; }
|
||||
uint32_t GetCompileFlags() const { return m_CompileFlags; }
|
||||
|
||||
private:
|
||||
static const uint32_t m_ShaderCacheMagic = 0xf000baba;
|
||||
static const uint32_t m_ShaderCacheVersion = 3;
|
||||
|
||||
Reference in New Issue
Block a user