mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-28 12:51:03 +00:00
Save program & program pipeline bindings
This commit is contained in:
@@ -89,6 +89,9 @@ void GLRenderState::FetchState()
|
||||
}
|
||||
|
||||
m_Real->glActiveTexture(ActiveTexture);
|
||||
|
||||
m_Real->glGetIntegerv(eGL_CURRENT_PROGRAM, (GLint *)&Program);
|
||||
m_Real->glGetIntegerv(eGL_PROGRAM_PIPELINE_BINDING, (GLint *)&Pipeline);
|
||||
|
||||
m_Real->glGetIntegerv(eGL_ARRAY_BUFFER_BINDING, (GLint*)&BufferBindings[eBufIdx_Array]);
|
||||
m_Real->glGetIntegerv(eGL_COPY_READ_BUFFER_BINDING, (GLint*)&BufferBindings[eBufIdx_Copy_Read]);
|
||||
@@ -260,6 +263,9 @@ void GLRenderState::ApplyState()
|
||||
|
||||
m_Real->glActiveTexture(ActiveTexture);
|
||||
|
||||
m_Real->glUseProgram(Program);
|
||||
m_Real->glBindProgramPipeline(Pipeline);
|
||||
|
||||
m_Real->glBindBuffer(eGL_ARRAY_BUFFER, BufferBindings[eBufIdx_Array]);
|
||||
m_Real->glBindBuffer(eGL_COPY_READ_BUFFER, BufferBindings[eBufIdx_Copy_Read]);
|
||||
m_Real->glBindBuffer(eGL_COPY_WRITE_BUFFER, BufferBindings[eBufIdx_Copy_Write]);
|
||||
@@ -391,6 +397,10 @@ void GLRenderState::Clear()
|
||||
RDCEraseEl(Tex2D);
|
||||
RDCEraseEl(Samplers);
|
||||
RDCEraseEl(ActiveTexture);
|
||||
|
||||
RDCEraseEl(Program);
|
||||
RDCEraseEl(Pipeline);
|
||||
|
||||
RDCEraseEl(BufferBindings);
|
||||
RDCEraseEl(AtomicCounter);
|
||||
RDCEraseEl(ShaderStorage);
|
||||
@@ -457,6 +467,19 @@ void GLRenderState::Serialise(LogState state, void *ctx, GLResourceManager *rm)
|
||||
if(state < WRITING && ID != ResourceId()) BufferBindings[i] = rm->GetLiveResource(ID).name;
|
||||
}
|
||||
|
||||
{
|
||||
ResourceId ID = ResourceId();
|
||||
if(state >= WRITING) ID = rm->GetID(ProgramRes(ctx, Program));
|
||||
m_pSerialiser->Serialise("GL_CURRENT_PROGRAM", ID);
|
||||
if(state < WRITING && ID != ResourceId()) Program = rm->GetLiveResource(ID).name;
|
||||
}
|
||||
{
|
||||
ResourceId ID = ResourceId();
|
||||
if(state >= WRITING) ID = rm->GetID(ProgramPipeRes(ctx, Pipeline));
|
||||
m_pSerialiser->Serialise("GL_PROGRAM_PIPELINE_BINDING", ID);
|
||||
if(state < WRITING && ID != ResourceId()) Pipeline = rm->GetLiveResource(ID).name;
|
||||
}
|
||||
|
||||
{
|
||||
ResourceId ID = ResourceId();
|
||||
if(state >= WRITING) ID = rm->GetID(FramebufferRes(ctx, DrawFBO));
|
||||
|
||||
@@ -80,6 +80,9 @@ struct GLRenderState
|
||||
uint32_t Samplers[128];
|
||||
GLenum ActiveTexture;
|
||||
|
||||
GLuint Program;
|
||||
GLuint Pipeline;
|
||||
|
||||
enum
|
||||
{
|
||||
eBufIdx_Array,
|
||||
@@ -125,8 +128,6 @@ struct GLRenderState
|
||||
GLenum DrawBuffers[8];
|
||||
|
||||
// TODO:
|
||||
// Framebuffer Bindings
|
||||
// Program Bindings
|
||||
// Vertex Attribs/Buffers/Pointers etc
|
||||
// Image state (GL_IMAGE_BINDING_NAME)
|
||||
// multisampling
|
||||
|
||||
Reference in New Issue
Block a user