Save and load edited shaders as capture modifications

* When a shader edit is loaded with a capture, it's loaded as "pending" and not
  immediately applied.
This commit is contained in:
baldurk
2020-10-21 14:14:20 +01:00
parent 31bf9f4593
commit 806187f613
11 changed files with 429 additions and 71 deletions
+4 -3
View File
@@ -4368,8 +4368,9 @@ void TextureViewer::on_customEdit_clicked()
ResourceId(), ShaderStage::Fragment, lit("main"), files,
encodingExtensions[QFileInfo(filename).completeSuffix()], ShaderCompileFlags(),
// Save Callback
[thisPointer, key, filename, path](ICaptureContext *ctx, IShaderViewer *viewer,
ShaderEncoding, ShaderCompileFlags, rdcstr, bytebuf bytes) {
[thisPointer, key, filename, path](ICaptureContext *ctx, IShaderViewer *viewer, ResourceId,
ShaderStage, ShaderEncoding, ShaderCompileFlags, rdcstr,
bytebuf bytes) {
{
// don't trigger a full refresh
if(thisPointer)
@@ -4397,7 +4398,7 @@ void TextureViewer::on_customEdit_clicked()
}
},
[thisPointer, key](ICaptureContext *ctx) {
[thisPointer, key](ICaptureContext *, IShaderViewer *, ResourceId) {
if(thisPointer)
thisPointer->m_CustomShaderEditor.remove(key);
});