mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-27 12:21:11 +00:00
Implement glBindSampler
This commit is contained in:
@@ -134,6 +134,8 @@ enum GLChunkType
|
||||
FRAMEBUFFER_TEX,
|
||||
BIND_FRAMEBUFFER,
|
||||
|
||||
BIND_SAMPLER,
|
||||
|
||||
GEN_BUFFER,
|
||||
BIND_BUFFER,
|
||||
BIND_BUFFER_BASE,
|
||||
|
||||
@@ -321,13 +321,30 @@ void WrappedOpenGL::glGenSamplers(GLsizei count, GLuint *samplers)
|
||||
}
|
||||
}
|
||||
|
||||
bool WrappedOpenGL::Serialise_glBindSampler(GLuint unit, GLuint sampler)
|
||||
{
|
||||
SERIALISE_ELEMENT(uint32_t, Unit, unit);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(SamplerRes(sampler)));
|
||||
|
||||
if(m_State < WRITING)
|
||||
{
|
||||
GLResource res = GetResourceManager()->GetLiveResource(id);
|
||||
glBindSampler(Unit, res.name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glBindSampler(GLuint unit, GLuint sampler)
|
||||
{
|
||||
m_Real.glBindSampler(unit, sampler);
|
||||
|
||||
if(m_State >= WRITING)
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
RDCUNIMPLEMENTED();
|
||||
SCOPED_SERIALISE_CONTEXT(BIND_SAMPLER);
|
||||
Serialise_glBindSampler(unit, sampler);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,8 @@ const char *GLChunkNames[] =
|
||||
"glFramebufferTexture",
|
||||
"glBindFramebuffer",
|
||||
|
||||
"glBindSampler",
|
||||
|
||||
"glGenBuffers",
|
||||
"glBindBuffer",
|
||||
"glBindBufferBase",
|
||||
@@ -949,6 +951,10 @@ void WrappedOpenGL::ProcessChunk(uint64_t offset, GLChunkType context)
|
||||
Serialise_glBindFramebuffer(eGL_UNKNOWN_ENUM, 0);
|
||||
break;
|
||||
|
||||
case BIND_SAMPLER:
|
||||
Serialise_glBindSampler(0, 0);
|
||||
break;
|
||||
|
||||
case CLEAR:
|
||||
Serialise_glClear(0);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user