If displaying via a custom shader when saving texture, save that output

This commit is contained in:
baldurk
2015-11-18 22:30:47 +01:00
parent 73ad61d38e
commit c8a6d0dbb7
5 changed files with 29 additions and 0 deletions
+12
View File
@@ -98,6 +98,9 @@ namespace renderdoc
private static extern bool ReplayOutput_SetPixelContextLocation(IntPtr real, UInt32 x, UInt32 y);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void ReplayOutput_DisablePixelContext(IntPtr real);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void ReplayOutput_GetCustomShaderTexID(IntPtr real, ref ResourceId texid);
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern bool ReplayOutput_PickPixel(IntPtr real, ResourceId texID, bool customShader,
@@ -149,6 +152,15 @@ namespace renderdoc
ReplayOutput_DisablePixelContext(m_Real);
}
public ResourceId GetCustomShaderTexID()
{
ResourceId ret = ResourceId.Null;
ReplayOutput_GetCustomShaderTexID(m_Real, ref ret);
return ret;
}
public PixelValue PickPixel(ResourceId texID, bool customShader, UInt32 x, UInt32 y, UInt32 sliceFace, UInt32 mip, UInt32 sample)
{
IntPtr mem = CustomMarshal.Alloc(typeof(PixelValue));
+10
View File
@@ -3417,6 +3417,16 @@ namespace renderdocui.Windows
if (m_TexDisplay.Alpha && !checkerBack.Checked) m_SaveDialog.saveData.alpha = AlphaMapping.BlendToColour;
m_SaveDialog.tex = CurrentTexture;
if (m_TexDisplay.CustomShader != ResourceId.Null)
{
m_Core.Renderer.Invoke((ReplayRenderer r) =>
{
ResourceId id = m_Output.GetCustomShaderTexID();
if(id != ResourceId.Null)
m_SaveDialog.saveData.id = id;
});
}
if(m_SaveDialog.ShowDialog() == DialogResult.OK)
{
bool ret = false;