mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-17 20:16:31 +00:00
Add glBindMultiTextureEXT - still need to add rest of EXT_dsa funcs
This commit is contained in:
@@ -124,6 +124,7 @@ enum GLChunkType
|
||||
GEN_TEXTURE,
|
||||
BIND_TEXTURE,
|
||||
BIND_TEXTURES,
|
||||
BIND_MULTI_TEX,
|
||||
BIND_IMAGE_TEXTURE,
|
||||
BIND_IMAGE_TEXTURES,
|
||||
ACTIVE_TEXTURE,
|
||||
|
||||
@@ -44,6 +44,7 @@ const char *GLChunkNames[] =
|
||||
"glGenTextures",
|
||||
"glBindTexture",
|
||||
"glBindTextures",
|
||||
"glBindMultiTexture",
|
||||
"glBindImageTexture",
|
||||
"glBindImageTextures",
|
||||
"glActiveTexture",
|
||||
@@ -174,7 +175,7 @@ const char *GLChunkNames[] =
|
||||
"glDepthRangef",
|
||||
"glDepthRangeIndexed",
|
||||
"glDepthRangeArrayv",
|
||||
"glDepthBoundsEXT",
|
||||
"glDepthBounds",
|
||||
"glClipControl",
|
||||
"glProvokingVertex",
|
||||
"glPrimitiveRestartIndex",
|
||||
@@ -1682,6 +1683,9 @@ void WrappedOpenGL::ProcessChunk(uint64_t offset, GLChunkType context)
|
||||
case BIND_TEXTURES:
|
||||
Serialise_glBindTextures(0, 0, NULL);
|
||||
break;
|
||||
case BIND_MULTI_TEX:
|
||||
Serialise_glBindMultiTextureEXT(eGL_NONE, eGL_NONE, 0);
|
||||
break;
|
||||
case BIND_IMAGE_TEXTURE:
|
||||
Serialise_glBindImageTexture(0, 0, 0, 0, 0, eGL_NONE, eGL_NONE);
|
||||
break;
|
||||
|
||||
@@ -1064,6 +1064,7 @@ class WrappedOpenGL
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glNamedFramebufferRenderbufferEXT(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glNamedFramebufferTextureLayerEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glNamedFramebufferParameteriEXT(GLuint framebuffer, GLenum pname, GLint param));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glTextureBufferEXT(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glTextureBufferRangeEXT(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels));
|
||||
|
||||
@@ -628,6 +628,7 @@ struct GLHookSet
|
||||
PFNGLGETTEXTUREPARAMETERIVEXTPROC glGetTextureParameterivEXT;
|
||||
PFNGLGETTEXTUREPARAMETERFVEXTPROC glGetTextureParameterfvEXT;
|
||||
PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glGetTextureLevelParameterivEXT;
|
||||
PFNGLBINDMULTITEXTUREEXTPROC glBindMultiTextureEXT;
|
||||
PFNGLMAPNAMEDBUFFEREXTPROC glMapNamedBufferEXT;
|
||||
PFNGLMAPNAMEDBUFFERRANGEEXTPROC glMapNamedBufferRangeEXT;
|
||||
PFNGLNAMEDBUFFERDATAEXTPROC glNamedBufferDataEXT;
|
||||
|
||||
@@ -660,6 +660,7 @@
|
||||
HookExtension(PFNGLGETTEXTUREPARAMETERIVEXTPROC, glGetTextureParameterivEXT); \
|
||||
HookExtension(PFNGLGETTEXTUREPARAMETERFVEXTPROC, glGetTextureParameterfvEXT); \
|
||||
HookExtension(PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC, glGetTextureLevelParameterivEXT); \
|
||||
HookExtension(PFNGLBINDMULTITEXTUREEXTPROC, glBindMultiTextureEXT); \
|
||||
HookExtension(PFNGLMAPNAMEDBUFFEREXTPROC, glMapNamedBufferEXT); \
|
||||
HookExtension(PFNGLMAPNAMEDBUFFERRANGEEXTPROC, glMapNamedBufferRangeEXT); \
|
||||
HookExtension(PFNGLNAMEDBUFFERDATAEXTPROC, glNamedBufferDataEXT); \
|
||||
@@ -1356,6 +1357,7 @@
|
||||
HookWrapper4(void, glGetTextureParameterivEXT, GLuint, texture, GLenum, target, GLenum, pname, GLint *, params); \
|
||||
HookWrapper4(void, glGetTextureParameterfvEXT, GLuint, texture, GLenum, target, GLenum, pname, GLfloat *, params); \
|
||||
HookWrapper5(void, glGetTextureLevelParameterivEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, pname, GLint *, params); \
|
||||
HookWrapper3(void, glBindMultiTextureEXT, GLenum, texunit, GLenum, target, GLuint, texture); \
|
||||
HookWrapper2(void *, glMapNamedBufferEXT, GLuint, buffer, GLenum, access); \
|
||||
HookWrapper4(void *, glMapNamedBufferRangeEXT, GLuint, buffer, GLintptr, offset, GLsizeiptr, length, GLbitfield, access); \
|
||||
HookWrapper4(void, glNamedBufferDataEXT, GLuint, buffer, GLsizeiptr, size, const void *, data, GLenum, usage); \
|
||||
|
||||
@@ -247,6 +247,95 @@ void WrappedOpenGL::glBindTextures(GLuint first, GLsizei count, const GLuint *te
|
||||
}
|
||||
}
|
||||
|
||||
bool WrappedOpenGL::Serialise_glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture)
|
||||
{
|
||||
SERIALISE_ELEMENT(GLenum, Target, target);
|
||||
SERIALISE_ELEMENT(uint32_t, Unit, texunit-eGL_TEXTURE0);
|
||||
SERIALISE_ELEMENT(ResourceId, Id, (texture ? GetResourceManager()->GetID(TextureRes(GetCtx(), texture)) : ResourceId()));
|
||||
|
||||
if(m_State == WRITING_IDLE)
|
||||
{
|
||||
m_TextureRecord[Unit]->datatype = TextureBinding(Target);
|
||||
}
|
||||
else if(m_State < WRITING)
|
||||
{
|
||||
if(Id == ResourceId())
|
||||
{
|
||||
m_Real.glBindMultiTextureEXT(GLenum(eGL_TEXTURE0+Unit), Target, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
GLResource res = GetResourceManager()->GetLiveResource(Id);
|
||||
m_Real.glBindMultiTextureEXT(GLenum(eGL_TEXTURE0+Unit), Target, res.name);
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
m_Textures[GetResourceManager()->GetLiveID(Id)].curType = TextureTarget(Target);
|
||||
m_Textures[GetResourceManager()->GetLiveID(Id)].creationFlags |= eTextureCreate_SRV;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture)
|
||||
{
|
||||
m_Real.glBindMultiTextureEXT(texunit, target, texture);
|
||||
|
||||
if(GetResourceManager()->GetID(TextureRes(GetCtx(), texture)) == ResourceId())
|
||||
return;
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
Chunk *chunk = NULL;
|
||||
|
||||
{
|
||||
SCOPED_SERIALISE_CONTEXT(BIND_MULTI_TEX);
|
||||
Serialise_glBindMultiTextureEXT(texunit, target, texture);
|
||||
|
||||
chunk = scope.Get();
|
||||
}
|
||||
|
||||
m_ContextRecord->AddChunk(chunk);
|
||||
}
|
||||
else if(m_State < WRITING)
|
||||
{
|
||||
m_Textures[GetResourceManager()->GetID(TextureRes(GetCtx(), texture))].curType = TextureTarget(target);
|
||||
}
|
||||
|
||||
if(texture == 0)
|
||||
{
|
||||
m_TextureRecord[texunit-eGL_TEXTURE0] = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
GLResourceRecord *r = m_TextureRecord[texunit-eGL_TEXTURE0] = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
|
||||
if(r->datatype)
|
||||
{
|
||||
// it's illegal to retype a texture
|
||||
RDCASSERT(r->datatype == TextureBinding(target));
|
||||
}
|
||||
else
|
||||
{
|
||||
Chunk *chunk = NULL;
|
||||
|
||||
// this is just a 'typing' bind, so doesn't need to be to the right slot, just anywhere.
|
||||
{
|
||||
SCOPED_SERIALISE_CONTEXT(BIND_TEXTURE);
|
||||
Serialise_glBindTexture(target, texture);
|
||||
|
||||
chunk = scope.Get();
|
||||
}
|
||||
|
||||
r->AddChunk(chunk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool WrappedOpenGL::Serialise_glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
|
||||
{
|
||||
SERIALISE_ELEMENT(uint32_t, Unit, unit);
|
||||
|
||||
Reference in New Issue
Block a user