mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-19 13:06:38 +00:00
Pass through and allow different source shader encodings when editing
* This means e.g. the D3D11 back-end can accept DXBC directly if the UI can provide it, or compile from HLSL as before. * More importantly, the Vulkan back-end can take SPIR-V compiled from any source, or compile from GLSL as before as a fall-back.
This commit is contained in:
@@ -3872,15 +3872,17 @@ void TextureViewer::on_customEdit_clicked()
|
||||
files.push_back(make_rdcpair<rdcstr, rdcstr>(filename, src));
|
||||
|
||||
IShaderViewer *s = m_Ctx.EditShader(
|
||||
true, lit("main"), files,
|
||||
true, ShaderStage::Fragment, lit("main"), files,
|
||||
IsD3D(m_Ctx.APIProps().localRenderer) ? ShaderEncoding::HLSL : ShaderEncoding::GLSL,
|
||||
ShaderCompileFlags(),
|
||||
// Save Callback
|
||||
[this, key, filename, path](ICaptureContext *ctx, IShaderViewer *viewer,
|
||||
const rdcstrpairs &updatedfiles) {
|
||||
[this, key, filename, path](ICaptureContext *ctx, IShaderViewer *viewer, ShaderEncoding encoding,
|
||||
ShaderCompileFlags flags, rdcstr entryFunc, bytebuf bytes) {
|
||||
{
|
||||
QFile fileHandle(path);
|
||||
if(fileHandle.open(QFile::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
||||
{
|
||||
fileHandle.write(updatedfiles[0].second.c_str());
|
||||
fileHandle.write(QByteArray(bytes));
|
||||
fileHandle.close();
|
||||
|
||||
// watcher doesn't trigger on internal modifications
|
||||
|
||||
Reference in New Issue
Block a user