Include transform feedback state in GL pipeline state

This commit is contained in:
baldurk
2015-01-17 21:47:06 +00:00
parent 11c2d4bdcc
commit d80687832f
3 changed files with 54 additions and 0 deletions
+10
View File
@@ -146,6 +146,16 @@ struct GLPipelineState
};
rdctype::array<Buffer> UniformBuffers;
struct Feedback
{
ResourceId Obj;
ResourceId BufferBinding[4];
uint64_t Offset[4];
uint64_t Size[4];
bool32 Active;
bool32 Paused;
} m_Feedback;
struct Rasterizer
{
struct Viewport
+28
View File
@@ -1156,6 +1156,34 @@ void GLReplay::SavePipelineState()
}
}
RDCEraseEl(pipe.m_Feedback);
GLuint feedback = 0;
gl.glGetIntegerv(eGL_TRANSFORM_FEEDBACK_BINDING, (GLint*)&feedback);
if(feedback != 0)
{
pipe.m_Feedback.Obj = rm->GetID(FeedbackRes(ctx, feedback));
GLint maxCount = 0;
gl.glGetIntegerv(eGL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxCount);
for(int i=0; i < (int)ARRAY_COUNT(pipe.m_Feedback.BufferBinding) && i < maxCount; i++)
{
GLuint buffer = 0;
gl.glGetIntegeri_v(eGL_TRANSFORM_FEEDBACK_BUFFER_BINDING, i, (GLint*)&buffer);pipe.m_Feedback.BufferBinding[i] = rm->GetID(BufferRes(ctx, buffer));
gl.glGetInteger64i_v(eGL_TRANSFORM_FEEDBACK_BUFFER_START, i, (GLint64*)&pipe.m_Feedback.Offset[i]);
gl.glGetInteger64i_v(eGL_TRANSFORM_FEEDBACK_BUFFER_SIZE, i, (GLint64*)&pipe.m_Feedback.Size[i]);
}
GLint p=0;
gl.glGetIntegerv(eGL_TRANSFORM_FEEDBACK_BUFFER_PAUSED, &p);
pipe.m_Feedback.Paused = (p != 0);
gl.glGetIntegerv(eGL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE, &p);
pipe.m_Feedback.Active = (p != 0);
}
for(int i=0; i < 6; i++)
{
size_t num = RDCMIN(128, rs.Subroutines[i].numSubroutines);
+16
View File
@@ -161,6 +161,22 @@ namespace renderdoc
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public Buffer[] UniformBuffers;
[StructLayout(LayoutKind.Sequential)]
public class Feedback
{
ResourceId Obj;
[CustomMarshalAs(CustomUnmanagedType.FixedArray, FixedLength = 4)]
ResourceId[] BufferBinding;
[CustomMarshalAs(CustomUnmanagedType.FixedArray, FixedLength = 4)]
UInt64[] Offset;
[CustomMarshalAs(CustomUnmanagedType.FixedArray, FixedLength = 4)]
UInt64[] Size;
bool Active;
bool Paused;
};
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
public Feedback m_Feedback;
[StructLayout(LayoutKind.Sequential)]
public class Rasterizer
{