mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Fix up fetching layer/mip for FBOs on replay
This commit is contained in:
@@ -585,7 +585,7 @@ namespace renderdocui.Code
|
||||
if (IsLogD3D11)
|
||||
return m_D3D11.m_OM.DepthTarget.Resource;
|
||||
else if (IsLogGL)
|
||||
return m_GL.m_FB.m_DrawFBO.Depth;
|
||||
return m_GL.m_FB.m_DrawFBO.Depth.Obj;
|
||||
}
|
||||
|
||||
return ResourceId.Null;
|
||||
@@ -598,7 +598,7 @@ namespace renderdocui.Code
|
||||
if (IsLogD3D11)
|
||||
return m_D3D11.m_OM.DepthTarget.Resource;
|
||||
else if (IsLogGL)
|
||||
return m_GL.m_FB.m_DrawFBO.Stencil;
|
||||
return m_GL.m_FB.m_DrawFBO.Stencil.Obj;
|
||||
}
|
||||
|
||||
return ResourceId.Null;
|
||||
@@ -648,7 +648,7 @@ namespace renderdocui.Code
|
||||
{
|
||||
int db = m_GL.m_FB.m_DrawFBO.DrawBuffers[i];
|
||||
if(db >= 0)
|
||||
ret[i] = m_GL.m_FB.m_DrawFBO.Color[db];
|
||||
ret[i] = m_GL.m_FB.m_DrawFBO.Color[db].Obj;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -668,7 +668,7 @@ namespace renderdocui.Code
|
||||
return m_D3D11.m_OM.DepthTarget.Resource;
|
||||
|
||||
if (IsLogGL)
|
||||
return m_GL.m_FB.m_DrawFBO.Depth;
|
||||
return m_GL.m_FB.m_DrawFBO.Depth.Obj;
|
||||
}
|
||||
|
||||
return ResourceId.Null;
|
||||
@@ -685,7 +685,7 @@ namespace renderdocui.Code
|
||||
return m_D3D11.m_OM.DepthTarget.Resource;
|
||||
|
||||
if (IsLogGL)
|
||||
return m_GL.m_FB.m_DrawFBO.Stencil;
|
||||
return m_GL.m_FB.m_DrawFBO.Stencil.Obj;
|
||||
}
|
||||
|
||||
return ResourceId.Null;
|
||||
|
||||
@@ -312,6 +312,14 @@ namespace renderdoc
|
||||
public class FrameBuffer
|
||||
{
|
||||
public bool FramebufferSRGB;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class Attachment
|
||||
{
|
||||
public ResourceId Obj;
|
||||
public UInt32 Layer;
|
||||
public UInt32 Mip;
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class FBO
|
||||
@@ -319,13 +327,9 @@ namespace renderdoc
|
||||
public ResourceId Obj;
|
||||
|
||||
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
|
||||
public ResourceId[] Color;
|
||||
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
|
||||
public UInt32[] Layer;
|
||||
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
|
||||
public UInt32[] Mip;
|
||||
public ResourceId Depth;
|
||||
public ResourceId Stencil;
|
||||
public Attachment[] Color;
|
||||
public Attachment Depth;
|
||||
public Attachment Stencil;
|
||||
|
||||
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
|
||||
public Int32[] DrawBuffers;
|
||||
|
||||
@@ -1324,7 +1324,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
{
|
||||
ResourceId p = ResourceId.Null;
|
||||
|
||||
if (db >= 0) p = state.m_FB.m_DrawFBO.Color[db];
|
||||
if (db >= 0) p = state.m_FB.m_DrawFBO.Color[db].Obj;
|
||||
|
||||
if (p != ResourceId.Null || showEmpty.Checked)
|
||||
{
|
||||
@@ -1384,7 +1384,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
|
||||
{
|
||||
int i = 0;
|
||||
foreach (ResourceId depthstencil in new ResourceId[] { state.m_FB.m_DrawFBO.Depth, state.m_FB.m_DrawFBO.Stencil })
|
||||
foreach (ResourceId depthstencil in new ResourceId[] { state.m_FB.m_DrawFBO.Depth.Obj, state.m_FB.m_DrawFBO.Stencil.Obj })
|
||||
{
|
||||
if (depthstencil != ResourceId.Null || showEmpty.Checked)
|
||||
{
|
||||
|
||||
@@ -112,6 +112,21 @@ namespace renderdocui.Windows
|
||||
|
||||
return view != null ? (int)view.HighestMip : -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Type == FollowType.OutputColour)
|
||||
{
|
||||
return (int)core.CurGLPipelineState.m_FB.m_DrawFBO.Color[index].Mip;
|
||||
}
|
||||
else if (Type == FollowType.OutputDepth)
|
||||
{
|
||||
return (int)core.CurGLPipelineState.m_FB.m_DrawFBO.Depth.Mip;
|
||||
}
|
||||
else if (Type == FollowType.ReadWriteRes)
|
||||
{
|
||||
return (int)core.CurGLPipelineState.Images[index].Level;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -144,12 +159,20 @@ namespace renderdocui.Windows
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Type == FollowType.ReadWriteRes)
|
||||
if (Type == FollowType.OutputColour)
|
||||
{
|
||||
return (int)core.CurGLPipelineState.m_FB.m_DrawFBO.Color[index].Layer;
|
||||
}
|
||||
else if (Type == FollowType.OutputDepth)
|
||||
{
|
||||
return (int)core.CurGLPipelineState.m_FB.m_DrawFBO.Depth.Layer;
|
||||
}
|
||||
else if (Type == FollowType.ReadWriteRes)
|
||||
{
|
||||
if(!core.CurGLPipelineState.Images[index].Layered)
|
||||
return (int)core.CurGLPipelineState.Images[index].Layer;
|
||||
}
|
||||
if (Type == FollowType.PSResource)
|
||||
else if (Type == FollowType.PSResource)
|
||||
{
|
||||
return (int)core.CurGLPipelineState.Textures[index].FirstSlice;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user