mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Add support for file includes from custom shaders. Closes #2275
This commit is contained in:
@@ -4326,12 +4326,22 @@ void TextureViewer::reloadCustomShaders(const QString &filter)
|
||||
|
||||
fileHandle.close();
|
||||
|
||||
rdcarray<rdcstr> dirs;
|
||||
|
||||
for(QDir d : getShaderDirectories())
|
||||
{
|
||||
if(d.exists())
|
||||
dirs.push_back(d.absolutePath());
|
||||
}
|
||||
|
||||
m_CustomShaders[key] = ResourceId();
|
||||
m_CustomShadersBusy.push_back(key);
|
||||
m_Ctx.Replay().AsyncInvoke(
|
||||
[this, fn, key, shaderBytes, encoding, errors](IReplayController *r) {
|
||||
[this, fn, dirs, key, shaderBytes, encoding, errors](IReplayController *r) {
|
||||
rdcstr buildErrors;
|
||||
|
||||
r->SetCustomShaderIncludes(dirs);
|
||||
|
||||
ResourceId id;
|
||||
rdctie(id, buildErrors) = r->BuildCustomShader(
|
||||
"main", encoding, shaderBytes, ShaderCompileFlags(), ShaderStage::Pixel);
|
||||
|
||||
Reference in New Issue
Block a user