mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-28 09:26:52 +00:00
If displaying via a custom shader when saving texture, save that output
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user