]> git.cworth.org Git - vogl/commitdiff
- Features for 10ft: PBO's, snapshotting/restoring mapped buffers during replaying
authorRich Geldreich <richgel99@gmail.com>
Fri, 14 Mar 2014 21:35:20 +0000 (14:35 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 1 Apr 2014 19:37:28 +0000 (12:37 -0700)
- Display lists snapshot/restoring: genned but still not-valid display lists are now handled properly

(cherry picked from commit fd44f7dcce80103562bd0c49ea15f6f6031fdc83)

Conflicts:
bin_richg/trace.sh
scratch/bdeen/hold/glireplay/gli_replay_tool.cpp
src/voglcommon/vogl_gl_replayer.cpp

14 files changed:
glspec/dbg_final_gl_glx_whitelisted_funcs.txt
glspec/dbg_gl_all_funcs.txt
glspec/dbg_gl_funcs.txt
glspec/gl_glx_simple_replay_funcs.txt
glspec/gl_glx_whitelisted_funcs.txt
src/voglcommon/vogl_buffer_state.cpp
src/voglcommon/vogl_buffer_state.h
src/voglcommon/vogl_display_list_state.cpp
src/voglcommon/vogl_gl_replayer.cpp
src/voglcommon/vogl_gl_replayer.h
src/voglcommon/vogl_gl_state_snapshot.cpp
src/voglcommon/vogl_gl_state_snapshot.h
src/voglcommon/vogl_gl_utils.cpp
src/vogltrace/vogl_intercept.cpp

index 316e1e3cea2b73502ca903e3f07f5fba7af74bb2..162c057cc0b6a42c9696333c867581b09b2fdf5c 100644 (file)
@@ -140,6 +140,12 @@ glColorTable
 glColorTableEXT
 glColorTableParameterfv
 glColorTableParameteriv
+glCombinerInputNV
+glCombinerOutputNV
+glCombinerParameterfNV
+glCombinerParameterfvNV
+glCombinerParameteriNV
+glCombinerParameterivNV
 glCompileShader
 glCompileShaderARB
 glCompressedTexImage1D
@@ -268,6 +274,7 @@ glEvalPoint1
 glEvalPoint2
 glFeedbackBuffer
 glFenceSync
+glFinalCombinerInputNV
 glFinish
 glFlush
 glFlushMappedBufferRange
index 5cd3607647d66733f75178ff29d87f0ca4110e83..a4c487c2555e58cab282bf4df954a9ad5b66e7cf 100644 (file)
@@ -4220,14 +4220,14 @@ Name: "CopyBufferSubData", ParamNames: 5, Params: 5, Return: "void", Category: "
   Name: "size", Type: "BufferSize", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawElementsBaseVertex", ParamNames: 5, Params: 5, Return: "void", Category: "ARB_draw_elements_base_vertex", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "DrawElementsType", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[COMPSIZE(count,type)]", Retained: 0
   Name: "basevertex", Type: "Int32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawRangeElementsBaseVertex", ParamNames: 7, Params: 7, Return: "void", Category: "ARB_draw_elements_base_vertex", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "start", Type: "UInt32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "end", Type: "UInt32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
@@ -4236,7 +4236,7 @@ Name: "DrawRangeElementsBaseVertex", ParamNames: 7, Params: 7, Return: "void", C
   Name: "basevertex", Type: "Int32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawElementsInstancedBaseVertex", ParamNames: 6, Params: 6, Return: "void", Category: "ARB_draw_elements_base_vertex", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "DrawElementsType", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[COMPSIZE(count,type)]", Retained: 0
@@ -4244,7 +4244,7 @@ Name: "DrawElementsInstancedBaseVertex", ParamNames: 6, Params: 6, Return: "void
   Name: "basevertex", Type: "Int32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "MultiDrawElementsBaseVertex", ParamNames: 6, Params: 6, Return: "void", Category: "ARB_draw_elements_base_vertex", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "array", ArraySize: "[drawcount]", Retained: 0
   Name: "type", Type: "DrawElementsType", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "ConstVoidPointer", Direction: "in", Semantic: "array", ArraySize: "[drawcount]", Retained: 0
@@ -4639,7 +4639,7 @@ Name: "DrawArraysIndirect", ParamNames: 2, Params: 2, Return: "void", Category:
   Name: "indirect", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[]", Retained: 0
 
 Name: "DrawElementsIndirect", ParamNames: 3, Params: 3, Return: "void", Category: "ARB_draw_indirect", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indirect", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[]", Retained: 0
 
@@ -5520,7 +5520,7 @@ Name: "DrawArraysInstancedBaseInstance", ParamNames: 5, Params: 5, Return: "void
   Name: "baseinstance", Type: "UInt32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawElementsInstancedBaseInstance", ParamNames: 6, Params: 6, Return: "void", Category: "ARB_base_instance", Version: "4.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "void", Direction: "in", Semantic: "array", ArraySize: "[count]", Retained: 0
@@ -5528,7 +5528,7 @@ Name: "DrawElementsInstancedBaseInstance", ParamNames: 6, Params: 6, Return: "vo
   Name: "baseinstance", Type: "UInt32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawElementsInstancedBaseVertexBaseInstance", ParamNames: 7, Params: 7, Return: "void", Category: "ARB_base_instance", Version: "4.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "void", Direction: "in", Semantic: "array", ArraySize: "[count]", Retained: 0
@@ -5887,7 +5887,7 @@ Name: "MultiDrawArraysIndirect", ParamNames: 4, Params: 4, Return: "void", Categ
   Name: "stride", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "MultiDrawElementsIndirect", ParamNames: 5, Params: 5, Return: "void", Category: "ARB_multi_draw_indirect", Version: "4.3", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indirect", Type: "void", Direction: "in", Semantic: "array", ArraySize: "[COMPSIZE(drawcount,stride)]", Retained: 0
   Name: "drawcount", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
@@ -12773,7 +12773,7 @@ Name: "MultiDrawArraysIndirectAMD", ParamNames: 4, Params: 4, Return: "void", Ca
   Name: "stride", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "MultiDrawElementsIndirectAMD", ParamNames: 5, Params: 5, Return: "void", Category: "AMD_multi_draw_indirect", Version: "4.0", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indirect", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[]", Retained: 0
   Name: "primcount", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
index d143d9eecee0bb04b327316802a939e7a4c7b9f0..c8775f0d64a8a7d4f35442f27fec9e7c351e9f26 100644 (file)
@@ -4220,14 +4220,14 @@ Name: "CopyBufferSubData", ParamNames: 5, Params: 5, Return: "void", Category: "
   Name: "size", Type: "BufferSize", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawElementsBaseVertex", ParamNames: 5, Params: 5, Return: "void", Category: "ARB_draw_elements_base_vertex", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "DrawElementsType", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[COMPSIZE(count,type)]", Retained: 0
   Name: "basevertex", Type: "Int32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawRangeElementsBaseVertex", ParamNames: 7, Params: 7, Return: "void", Category: "ARB_draw_elements_base_vertex", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "start", Type: "UInt32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "end", Type: "UInt32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
@@ -4236,7 +4236,7 @@ Name: "DrawRangeElementsBaseVertex", ParamNames: 7, Params: 7, Return: "void", C
   Name: "basevertex", Type: "Int32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawElementsInstancedBaseVertex", ParamNames: 6, Params: 6, Return: "void", Category: "ARB_draw_elements_base_vertex", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "DrawElementsType", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[COMPSIZE(count,type)]", Retained: 0
@@ -4244,7 +4244,7 @@ Name: "DrawElementsInstancedBaseVertex", ParamNames: 6, Params: 6, Return: "void
   Name: "basevertex", Type: "Int32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "MultiDrawElementsBaseVertex", ParamNames: 6, Params: 6, Return: "void", Category: "ARB_draw_elements_base_vertex", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "array", ArraySize: "[drawcount]", Retained: 0
   Name: "type", Type: "DrawElementsType", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "ConstVoidPointer", Direction: "in", Semantic: "array", ArraySize: "[drawcount]", Retained: 0
@@ -4639,7 +4639,7 @@ Name: "DrawArraysIndirect", ParamNames: 2, Params: 2, Return: "void", Category:
   Name: "indirect", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[]", Retained: 0
 
 Name: "DrawElementsIndirect", ParamNames: 3, Params: 3, Return: "void", Category: "ARB_draw_indirect", Version: "1.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indirect", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[]", Retained: 0
 
@@ -5520,7 +5520,7 @@ Name: "DrawArraysInstancedBaseInstance", ParamNames: 5, Params: 5, Return: "void
   Name: "baseinstance", Type: "UInt32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawElementsInstancedBaseInstance", ParamNames: 6, Params: 6, Return: "void", Category: "ARB_base_instance", Version: "4.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "void", Direction: "in", Semantic: "array", ArraySize: "[count]", Retained: 0
@@ -5528,7 +5528,7 @@ Name: "DrawElementsInstancedBaseInstance", ParamNames: 6, Params: 6, Return: "vo
   Name: "baseinstance", Type: "UInt32", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "DrawElementsInstancedBaseVertexBaseInstance", ParamNames: 7, Params: 7, Return: "void", Category: "ARB_base_instance", Version: "4.2", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "count", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indices", Type: "void", Direction: "in", Semantic: "array", ArraySize: "[count]", Retained: 0
@@ -5887,7 +5887,7 @@ Name: "MultiDrawArraysIndirect", ParamNames: 4, Params: 4, Return: "void", Categ
   Name: "stride", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "MultiDrawElementsIndirect", ParamNames: 5, Params: 5, Return: "void", Category: "ARB_multi_draw_indirect", Version: "4.3", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indirect", Type: "void", Direction: "in", Semantic: "array", ArraySize: "[COMPSIZE(drawcount,stride)]", Retained: 0
   Name: "drawcount", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
@@ -12773,7 +12773,7 @@ Name: "MultiDrawArraysIndirectAMD", ParamNames: 4, Params: 4, Return: "void", Ca
   Name: "stride", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
 
 Name: "MultiDrawElementsIndirectAMD", ParamNames: 5, Params: 5, Return: "void", Category: "AMD_multi_draw_indirect", Version: "4.0", Profile: "", Deprecated: "", Lib: "gl" notlistable: 0
-  Name: "mode", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
+  Name: "mode", Type: "BeginMode", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "type", Type: "GLenum", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
   Name: "indirect", Type: "Void", Direction: "in", Semantic: "array", ArraySize: "[]", Retained: 0
   Name: "primcount", Type: "SizeI", Direction: "in", Semantic: "value", ArraySize: "", Retained: 0
index 6c49336edd73254f7dd6c9cb6f94c374520cecf8..38f311e535e6b0fdbc3dbda830287d1f94126eb8 100644 (file)
@@ -3,7 +3,6 @@ glActiveStencilFaceEXT
 glActiveTexture
 glActiveTextureARB
 glAlphaFunc
-glBitmap
 glBlendColor
 glBlendColorEXT
 glBlendEquation
@@ -88,10 +87,6 @@ glColorP3ui
 glColorP3uiv
 glColorP4ui
 glColorP4uiv
-glColorSubTable
-glColorSubTableEXT
-glColorTable
-glColorTableEXT
 glColorTableParameterfv
 glColorTableParameteriv
 glCombinerInputNV
@@ -112,8 +107,6 @@ glCompressedTexSubImage2D
 glCompressedTexSubImage2DARB
 glCompressedTexSubImage3D
 glCompressedTexSubImage3DARB
-glConvolutionFilter1D
-glConvolutionFilter2D
 glConvolutionParameterf
 glConvolutionParameterfv
 glConvolutionParameteri
@@ -151,7 +144,6 @@ glDisableVertexAttribArrayARB
 glDrawBuffer
 glDrawBuffers
 glDrawBuffersARB
-glDrawPixels
 glEdgeFlag
 glEdgeFlagv
 glEnable
@@ -347,7 +339,6 @@ glPointSize
 glPolygonMode
 glPolygonOffset
 glPolygonOffsetEXT
-glPolygonStipple
 glPopAttrib
 glPopClientAttrib
 glPopMatrix
@@ -484,12 +475,8 @@ glTexGenf
 glTexGenfv
 glTexGeni
 glTexGeniv
-glTexImage1D
-glTexImage2D
 glTexImage2DMultisample
 glTexImage2DMultisampleCoverageNV
-glTexImage3D
-glTexImage3DEXT
 glTexImage3DMultisample
 glTexImage3DMultisampleCoverageNV
 glTexParameterf
@@ -505,12 +492,6 @@ glTexStorage2D
 glTexStorage2DMultisample
 glTexStorage3D
 glTexStorage3DMultisample
-glTexSubImage1D
-glTexSubImage1DEXT
-glTexSubImage2D
-glTexSubImage2DEXT
-glTexSubImage3D
-glTexSubImage3DEXT
 glTextureStorage1DEXT
 glTextureStorage2DEXT
 glTextureStorage2DMultisampleEXT
index b64928e75b7caea10caec81ce28d0354050d7179..6a63034d72f59bd5d619b5cd81317a27ec32659a 100644 (file)
@@ -30,6 +30,7 @@ glBindSampler
 glBindTexture
 glBindTextureEXT
 glBindVertexArray
+glBitmap
 glBlitFramebuffer
 glBlitFramebufferEXT
 glBufferData
@@ -44,8 +45,14 @@ glClearBufferuiv
 glClientWaitSync
 glColorPointer
 glColorPointerEXT
+glColorSubTable
+glColorSubTableEXT
+glColorTable
+glColorTableEXT
 glCompileShader
 glCompileShaderARB
+glConvolutionFilter1D
+glConvolutionFilter2D
 glCreateProgram
 glCreateProgramObjectARB
 glCreateShader
@@ -83,6 +90,7 @@ glDrawElementsInstanced
 glDrawElementsInstancedARB
 glDrawElementsInstancedBaseVertex
 glDrawElementsInstancedEXT
+glDrawPixels
 glDrawRangeElements
 glDrawRangeElementsBaseVertex
 glDrawRangeElementsEXT
@@ -99,7 +107,6 @@ glFenceSync
 glFlushMappedBufferRange
 glFogCoordPointer
 glFogCoordPointerEXT
-glFrameTerminatorGREMEDY
 glFramebufferRenderbuffer
 glFramebufferRenderbufferEXT
 glFramebufferTexture
@@ -111,6 +118,7 @@ glFramebufferTexture3D
 glFramebufferTexture3DEXT
 glFramebufferTextureLayer
 glFramebufferTextureLayerEXT
+glFrameTerminatorGREMEDY
 glGenBuffers
 glGenBuffersARB
 glGenFramebuffers
@@ -129,12 +137,12 @@ glGetActiveAtomicCounterBufferiv
 glGetActiveAttrib
 glGetActiveAttribARB
 glGetActiveSubroutineName
-glGetActiveSubroutineUniformName
 glGetActiveSubroutineUniformiv
+glGetActiveSubroutineUniformName
 glGetActiveUniform
 glGetActiveUniformARB
-glGetActiveUniformBlockName
 glGetActiveUniformBlockiv
+glGetActiveUniformBlockName
 glGetActiveUniformName
 glGetActiveUniformsiv
 glGetActiveUniformsiv
@@ -145,8 +153,8 @@ glGetAttachedObjectsARB
 glGetAttachedShaders
 glGetAttribLocation
 glGetAttribLocationARB
-glGetBooleanIndexedvEXT
 glGetBooleani_v
+glGetBooleanIndexedvEXT
 glGetBooleanv
 glGetBufferParameteri64v
 glGetBufferParameteriv
@@ -188,16 +196,16 @@ glGetDebugMessageLog
 glGetDebugMessageLogAMD
 glGetDebugMessageLogARB
 glGetDetailTexFuncSGIS
-glGetDoubleIndexedvEXT
 glGetDoublei_v
+glGetDoubleIndexedvEXT
 glGetDoublev
 glGetError
 glGetFenceivNV
 glGetFinalCombinerInputParameterfvNV
 glGetFinalCombinerInputParameterivNV
 glGetFixedvOES
-glGetFloatIndexedvEXT
 glGetFloati_v
+glGetFloatIndexedvEXT
 glGetFloatv
 glGetFogFuncSGIS
 glGetFragDataIndex
@@ -228,8 +236,8 @@ glGetInfoLogARB
 glGetInstrumentsSGIX
 glGetInteger64i_v
 glGetInteger64v
-glGetIntegerIndexedvEXT
 glGetIntegeri_v
+glGetIntegerIndexedvEXT
 glGetIntegerui64i_vNV
 glGetIntegerui64vNV
 glGetIntegerv
@@ -249,11 +257,11 @@ glGetLocalConstantIntegervEXT
 glGetMapAttribParameterfvNV
 glGetMapAttribParameterivNV
 glGetMapControlPointsNV
-glGetMapParameterfvNV
-glGetMapParameterivNV
 glGetMapdv
 glGetMapfv
 glGetMapiv
+glGetMapParameterfvNV
+glGetMapParameterivNV
 glGetMapxvOES
 glGetMaterialfv
 glGetMaterialiv
@@ -264,6 +272,9 @@ glGetMinmaxParameterfv
 glGetMinmaxParameterfvEXT
 glGetMinmaxParameteriv
 glGetMinmaxParameterivEXT
+glGetMultisamplefv
+glGetMultisamplefv
+glGetMultisamplefvNV
 glGetMultiTexEnvfvEXT
 glGetMultiTexEnvivEXT
 glGetMultiTexGendvEXT
@@ -272,28 +283,43 @@ glGetMultiTexGenivEXT
 glGetMultiTexImageEXT
 glGetMultiTexLevelParameterfvEXT
 glGetMultiTexLevelParameterivEXT
+glGetMultiTexParameterfvEXT
 glGetMultiTexParameterIivEXT
 glGetMultiTexParameterIuivEXT
-glGetMultiTexParameterfvEXT
 glGetMultiTexParameterivEXT
-glGetMultisamplefv
-glGetMultisamplefv
-glGetMultisamplefvNV
 glGetNamedBufferParameterivEXT
 glGetNamedBufferParameterui64vNV
 glGetNamedBufferPointervEXT
 glGetNamedBufferSubDataEXT
 glGetNamedFramebufferAttachmentParameterivEXT
 glGetNamedFramebufferParameterivEXT
-glGetNamedProgramLocalParameterIivEXT
-glGetNamedProgramLocalParameterIuivEXT
+glGetNamedProgramivEXT
 glGetNamedProgramLocalParameterdvEXT
 glGetNamedProgramLocalParameterfvEXT
+glGetNamedProgramLocalParameterIivEXT
+glGetNamedProgramLocalParameterIuivEXT
 glGetNamedProgramStringEXT
-glGetNamedProgramivEXT
 glGetNamedRenderbufferParameterivEXT
 glGetNamedStringARB
 glGetNamedStringivARB
+glGetnColorTableARB
+glGetnCompressedTexImageARB
+glGetnConvolutionFilterARB
+glGetnHistogramARB
+glGetnMapdvARB
+glGetnMapfvARB
+glGetnMapivARB
+glGetnMinmaxARB
+glGetnPixelMapfvARB
+glGetnPixelMapuivARB
+glGetnPixelMapusvARB
+glGetnPolygonStippleARB
+glGetnSeparableFilterARB
+glGetnTexImageARB
+glGetnUniformdvARB
+glGetnUniformfvARB
+glGetnUniformivARB
+glGetnUniformuivARB
 glGetObjectBufferfvATI
 glGetObjectBufferivATI
 glGetObjectLabel
@@ -318,10 +344,10 @@ glGetPathTexGenfvNV
 glGetPathTexGenivNV
 glGetPerfMonitorCounterDataAMD
 glGetPerfMonitorCounterInfoAMD
-glGetPerfMonitorCounterStringAMD
 glGetPerfMonitorCountersAMD
-glGetPerfMonitorGroupStringAMD
+glGetPerfMonitorCounterStringAMD
 glGetPerfMonitorGroupsAMD
+glGetPerfMonitorGroupStringAMD
 glGetPixelMapfv
 glGetPixelMapuiv
 glGetPixelMapusv
@@ -335,16 +361,19 @@ glGetPointerv
 glGetPointervEXT
 glGetPolygonStipple
 glGetProgramBinary
-glGetProgramEnvParameterIivNV
-glGetProgramEnvParameterIuivNV
 glGetProgramEnvParameterdvARB
 glGetProgramEnvParameterfvARB
+glGetProgramEnvParameterIivNV
+glGetProgramEnvParameterIuivNV
 glGetProgramInfoLog
 glGetProgramInterfaceiv
-glGetProgramLocalParameterIivNV
-glGetProgramLocalParameterIuivNV
+glGetProgramiv
+glGetProgramivARB
+glGetProgramivNV
 glGetProgramLocalParameterdvARB
 glGetProgramLocalParameterfvARB
+glGetProgramLocalParameterIivNV
+glGetProgramLocalParameterIuivNV
 glGetProgramNamedParameterdvNV
 glGetProgramNamedParameterfvNV
 glGetProgramParameterdvNV
@@ -352,18 +381,17 @@ glGetProgramParameterfvNV
 glGetProgramPipelineInfoLog
 glGetProgramPipelineiv
 glGetProgramResourceIndex
+glGetProgramResourceiv
 glGetProgramResourceLocation
 glGetProgramResourceLocationIndex
 glGetProgramResourceName
-glGetProgramResourceiv
 glGetProgramStageiv
 glGetProgramStringARB
 glGetProgramStringNV
 glGetProgramSubroutineParameteruivNV
-glGetProgramiv
-glGetProgramivARB
-glGetProgramivNV
 glGetQueryIndexediv
+glGetQueryiv
+glGetQueryivARB
 glGetQueryObjecti64v
 glGetQueryObjecti64vEXT
 glGetQueryObjectiv
@@ -372,21 +400,19 @@ glGetQueryObjectui64v
 glGetQueryObjectui64vEXT
 glGetQueryObjectuiv
 glGetQueryObjectuivARB
-glGetQueryiv
-glGetQueryivARB
 glGetRenderbufferParameteriv
 glGetRenderbufferParameterivEXT
+glGetSamplerParameterfv
 glGetSamplerParameterIiv
 glGetSamplerParameterIuiv
-glGetSamplerParameterfv
 glGetSamplerParameteriv
 glGetSeparableFilter
 glGetSeparableFilterEXT
 glGetShaderInfoLog
+glGetShaderiv
 glGetShaderPrecisionFormat
 glGetShaderSource
 glGetShaderSourceARB
-glGetShaderiv
 glGetSharpenTexFuncSGIS
 glGetString
 glGetStringi
@@ -407,21 +433,21 @@ glGetTexImage
 glGetTexLevelParameterfv
 glGetTexLevelParameteriv
 glGetTexLevelParameterxvOES
+glGetTexParameterfv
 glGetTexParameterIiv
 glGetTexParameterIivEXT
 glGetTexParameterIuiv
 glGetTexParameterIuivEXT
-glGetTexParameterPointervAPPLE
-glGetTexParameterfv
 glGetTexParameteriv
+glGetTexParameterPointervAPPLE
 glGetTexParameterxvOES
 glGetTextureHandleNV
 glGetTextureImageEXT
 glGetTextureLevelParameterfvEXT
 glGetTextureLevelParameterivEXT
+glGetTextureParameterfvEXT
 glGetTextureParameterIivEXT
 glGetTextureParameterIuivEXT
-glGetTextureParameterfvEXT
 glGetTextureParameterivEXT
 glGetTextureSamplerHandleNV
 glGetTrackMatrixivNV
@@ -430,18 +456,18 @@ glGetTransformFeedbackVaryingEXT
 glGetTransformFeedbackVaryingNV
 glGetUniformBlockIndex
 glGetUniformBufferSizeEXT
-glGetUniformIndices
-glGetUniformIndices
-glGetUniformLocation
-glGetUniformLocationARB
-glGetUniformOffsetEXT
-glGetUniformSubroutineuiv
 glGetUniformdv
 glGetUniformfv
 glGetUniformfvARB
 glGetUniformi64vNV
+glGetUniformIndices
+glGetUniformIndices
 glGetUniformiv
 glGetUniformivARB
+glGetUniformLocation
+glGetUniformLocationARB
+glGetUniformOffsetEXT
+glGetUniformSubroutineuiv
 glGetUniformui64vNV
 glGetUniformuiv
 glGetUniformuivEXT
@@ -454,10 +480,19 @@ glGetVariantPointervEXT
 glGetVaryingLocationNV
 glGetVertexAttribArrayObjectfvATI
 glGetVertexAttribArrayObjectivATI
+glGetVertexAttribdv
+glGetVertexAttribdvARB
+glGetVertexAttribdvNV
+glGetVertexAttribfv
+glGetVertexAttribfvARB
+glGetVertexAttribfvNV
 glGetVertexAttribIiv
 glGetVertexAttribIivEXT
 glGetVertexAttribIuiv
 glGetVertexAttribIuivEXT
+glGetVertexAttribiv
+glGetVertexAttribivARB
+glGetVertexAttribivNV
 glGetVertexAttribLdv
 glGetVertexAttribLdvEXT
 glGetVertexAttribLi64vNV
@@ -465,49 +500,22 @@ glGetVertexAttribLui64vNV
 glGetVertexAttribPointerv
 glGetVertexAttribPointervARB
 glGetVertexAttribPointervNV
-glGetVertexAttribdv
-glGetVertexAttribdvARB
-glGetVertexAttribdvNV
-glGetVertexAttribfv
-glGetVertexAttribfvARB
-glGetVertexAttribfvNV
-glGetVertexAttribiv
-glGetVertexAttribivARB
-glGetVertexAttribivNV
+glGetVideoCaptureivNV
 glGetVideoCaptureStreamdvNV
 glGetVideoCaptureStreamfvNV
 glGetVideoCaptureStreamivNV
-glGetVideoCaptureivNV
 glGetVideoi64vNV
 glGetVideoivNV
 glGetVideoui64vNV
 glGetVideouivNV
-glGetnColorTableARB
-glGetnCompressedTexImageARB
-glGetnConvolutionFilterARB
-glGetnHistogramARB
-glGetnMapdvARB
-glGetnMapfvARB
-glGetnMapivARB
-glGetnMinmaxARB
-glGetnPixelMapfvARB
-glGetnPixelMapuivARB
-glGetnPixelMapusvARB
-glGetnPolygonStippleARB
-glGetnSeparableFilterARB
-glGetnTexImageARB
-glGetnUniformdvARB
-glGetnUniformfvARB
-glGetnUniformivARB
-glGetnUniformuivARB
 glIndexPointer
 glIndexPointerEXT
 glInterleavedArrays
 glIsBuffer
 glIsBufferARB
 glIsEnabled
-glIsEnabledIndexedEXT
 glIsEnabledi
+glIsEnabledIndexedEXT
 glIsFramebuffer
 glIsFramebufferEXT
 glIsList
@@ -545,6 +553,7 @@ glNamedProgramLocalParametersI4uivEXT
 glNewList
 glNormalPointer
 glNormalPointerEXT
+glPolygonStipple
 glPrioritizeTextures
 glPrioritizeTexturesEXT
 glProgramBinary
@@ -586,11 +595,11 @@ glProgramUniformMatrix4x2fv
 glProgramUniformMatrix4x3fv
 glQueryCounter
 glReadPixels
-glSamplerParameterIiv
-glSamplerParameterIuiv
 glSamplerParameterf
 glSamplerParameterfv
 glSamplerParameteri
+glSamplerParameterIiv
+glSamplerParameterIuiv
 glSamplerParameteriv
 glSecondaryColorPointer
 glSecondaryColorPointerEXT
@@ -604,6 +613,16 @@ glTexBufferARB
 glTexBufferEXT
 glTexCoordPointer
 glTexCoordPointerEXT
+glTexImage1D
+glTexImage2D
+glTexImage3D
+glTexImage3DEXT
+glTexSubImage1D
+glTexSubImage1DEXT
+glTexSubImage2D
+glTexSubImage2DEXT
+glTexSubImage3D
+glTexSubImage3DEXT
 glTransformFeedbackVaryings
 glUniform1f
 glUniform1fARB
index c0539d0a66430ab36ddfc965c1f8628d71539302..619f1cb4525052dfa90598f56f0cd255360acf78 100644 (file)
@@ -26,6 +26,7 @@
 // File: vogl_buffer_state.cpp
 #include "vogl_common.h"
 #include "vogl_buffer_state.h"
+#include "vogl_gl_state_snapshot.h"
 
 vogl_buffer_state::vogl_buffer_state()
     : m_snapshot_handle(0),
@@ -96,18 +97,18 @@ bool vogl_buffer_state::snapshot(const vogl_context_info &context_info, vogl_han
             return false;
         }
 
-        if (m_params.get_value<int>(GL_BUFFER_MAPPED) != 0)
+        int buf_size = m_params.get_value<int>(GL_BUFFER_SIZE);
+        if (buf_size < 0)
         {
-            vogl_error_printf("%s: Can't snapshot buffer %" PRIu64 " target %s while it's currently mapped\n", VOGL_METHOD_NAME,
-                             (uint64_t)handle, g_gl_enums.find_gl_name(target));
+            vogl_error_printf("%s: Invalid buffer size, buffer %" PRIu64 " target %s size %i\n", VOGL_METHOD_NAME, (uint64_t)handle, g_gl_enums.find_gl_name(target), buf_size);
             clear();
             return false;
         }
 
-        int buf_size = m_params.get_value<int>(GL_BUFFER_SIZE);
-        if (buf_size < 0)
+        if (m_params.get_value<int>(GL_BUFFER_MAPPED) != 0)
         {
-            vogl_error_printf("%s: Invalid buffer size, buffer %" PRIu64 " target %s size %i\n", VOGL_METHOD_NAME, (uint64_t)handle, g_gl_enums.find_gl_name(target), buf_size);
+            vogl_error_printf("%s: Can't snapshot buffer %" PRIu64 " target %s while it's currently mapped\n", VOGL_METHOD_NAME,
+                             (uint64_t)handle, g_gl_enums.find_gl_name(target));
             clear();
             return false;
         }
@@ -136,6 +137,20 @@ bool vogl_buffer_state::snapshot(const vogl_context_info &context_info, vogl_han
     return true;
 }
 
+void vogl_buffer_state::set_mapped_buffer_snapshot_state(const vogl_mapped_buffer_desc &map_desc)
+{
+    VOGL_FUNC_TRACER
+
+    VOGL_ASSERT(map_desc.m_buffer == m_snapshot_handle);
+
+    m_is_mapped = true;
+
+    m_map_ofs = map_desc.m_offset;
+    m_map_size = map_desc.m_length;
+    m_map_access = map_desc.m_access;
+    m_map_range = map_desc.m_range;
+}
+
 bool vogl_buffer_state::restore(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLuint64 &handle) const
 {
     VOGL_FUNC_TRACER
@@ -231,6 +246,12 @@ void vogl_buffer_state::clear()
     m_buffer_data.clear();
     m_params.clear();
     m_is_valid = false;
+
+    m_map_ofs = 0;
+    m_map_size = 0;
+    m_map_access = 0;
+    m_map_range = false;
+    m_is_mapped = false;
 }
 
 bool vogl_buffer_state::serialize(json_node &node, vogl_blob_manager &blob_manager) const
@@ -261,6 +282,12 @@ bool vogl_buffer_state::serialize(json_node &node, vogl_blob_manager &blob_manag
     node.add_key_value("target", g_gl_enums.find_gl_name(m_target));
     node.add_key_value("buffer_data_blob_id", blob_id);
 
+    node.add_key_value("map_ofs", m_map_ofs);
+    node.add_key_value("map_size", m_map_size);
+    node.add_key_value("map_access", m_map_access);
+    node.add_key_value("map_range", m_map_range);
+    node.add_key_value("is_mapped", m_is_mapped);
+
     if (!m_params.serialize(node.add_object("params"), blob_manager))
         return false;
 
@@ -315,6 +342,12 @@ bool vogl_buffer_state::deserialize(const json_node &node, const vogl_blob_manag
         }
     }
 
+    m_map_ofs = node.value_as_uint64("map_ofs");
+    m_map_size = node.value_as_uint64("map_size");
+    m_map_access = node.value_as_uint32("map_access");
+    m_map_range = node.value_as_bool("map_range");
+    m_is_mapped = node.value_as_bool("is_mapped");
+
     m_is_valid = true;
 
     return true;
@@ -347,3 +380,28 @@ bool vogl_buffer_state::compare_restorable_state(const vogl_gl_object_state &rhs
 
     return true;
 }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
index c018bbb60af475a5bd5da77fe6bce8a31a1d8496..ca79ba3ab3e62535fb48c6762a29ebb7bf817847 100644 (file)
@@ -34,6 +34,8 @@
 #include "vogl_blob_manager.h"
 #include "vogl_vec.h"
 
+struct vogl_mapped_buffer_desc;
+
 class vogl_buffer_state : public vogl_gl_object_state
 {
 public:
@@ -51,6 +53,8 @@ public:
 
     virtual bool snapshot(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLuint64 handle, GLenum target);
 
+    void set_mapped_buffer_snapshot_state(const vogl_mapped_buffer_desc &map_desc);
+
     virtual bool restore(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLuint64 &handle) const;
 
     virtual bool remap_handles(vogl_handle_remapper &remapper);
@@ -86,6 +90,14 @@ public:
         return m_params;
     }
 
+    // Whether or not the buffer was currently mapped when it was snapshotted. Note we don't actually support snapshotting the buffer
+    // while it's mapped (we unmap it first), this data comes from the replayer's shadow. We also don't restore it in a mapped state, that's up to the caller.
+    bool get_is_map_range() const { return m_map_range; }
+    bool get_is_mapped() const { return m_is_mapped; }
+    uint64_t get_map_ofs() const { return m_map_ofs; }
+    uint64_t get_map_size() const { return m_map_size; }
+    uint get_map_access() const { return m_map_access; }
+
 private:
     GLuint m_snapshot_handle;
     GLenum m_target;
@@ -94,6 +106,12 @@ private:
 
     vogl_state_vector m_params;
 
+    uint64_t m_map_ofs;
+    uint64_t m_map_size;
+    uint m_map_access;
+    bool m_map_range;
+    bool m_is_mapped;
+
     bool m_is_valid;
 };
 
index f2eb470122f8c510bc24124f7e119dd90278cb2b..6b732b823d00c89345e8ac694975dcd820d7d0cb 100644 (file)
@@ -81,12 +81,11 @@ bool vogl_display_list::serialize(json_node &node, vogl_blob_manager &blob_manag
 {
     VOGL_FUNC_TRACER
 
-    if (!m_valid)
-        return false;
-
     node.add_key_value("handle", m_handle);
+    node.add_key_value("valid", m_valid);
     node.add_key_value("generating", m_generating);
     node.add_key_value("xfont", m_xfont);
+
     if (m_xfont)
     {
         node.add_key_value("xfont_glyph", m_xfont_glyph);
@@ -122,8 +121,10 @@ bool vogl_display_list::deserialize(const json_node &node, const vogl_blob_manag
     clear();
 
     m_handle = node.value_as_uint32("handle");
+    m_valid = node.value_as_bool("valid", true);
     m_generating = node.value_as_bool("generating");
     m_xfont = node.value_as_bool("xfont");
+
     if (m_xfont)
     {
         m_xfont_glyph = node.value_as_int("xfont_glyph");
@@ -158,8 +159,6 @@ bool vogl_display_list::deserialize(const json_node &node, const vogl_blob_manag
         }
     }
 
-    m_valid = true;
-
     return true;
 }
 
@@ -229,11 +228,7 @@ bool vogl_display_list_state::serialize(json_node &node, vogl_blob_manager &blob
 
         for (vogl_display_list_map::const_iterator it = m_display_lists.begin(); it != m_display_lists.end(); ++it)
         {
-            if (!it->second.is_valid())
-            {
-                vogl_warning_printf("%s: Unable to serialize display list at GL handle %u. This list is probably still being composed.\n", VOGL_METHOD_NAME, it->second.get_handle());
-                continue;
-            }
+            // It's OK if the display list isn't valid yet, it might just have been genned and not used.
             if (!it->second.serialize(lists_node.add_object(uint_to_string(it->first)), blob_manager, pCtypes))
                 return false;
         }
index b5ec733e30cc6205be37a1155f0a88aa48e3239d..f11a954f30cea9a8d81bd1d7f680dfac1ee66f91 100644 (file)
@@ -1350,6 +1350,9 @@ void vogl_gl_replayer::process_entrypoint_msg_print_detailed_context(eConsoleMes
 {
     VOGL_FUNC_TRACER
 
+    if (!m_pCur_gl_packet)
+        return;
+
     dump_packet_as_func_call(*m_pCur_gl_packet);
 
     if (!(m_flags & cGLReplayerDumpPacketsOnError))
@@ -1433,6 +1436,10 @@ vogl_gl_replayer::status_t vogl_gl_replayer::switch_contexts(vogl_trace_context_
 {
     VOGL_FUNC_TRACER
 
+    // HACK HACK
+    //if (m_pCur_gl_packet->get_call_counter() == 25583)
+    //    vogl_debug_break();
+
     //vogl_trace_context_ptr_value trace_context = gl_packet.m_context_handle;
     if (trace_context == m_cur_trace_context)
         return cStatusOK;
@@ -4494,13 +4501,15 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
 
                 GLuint replay_id = it->second;
 
-                for (uint i = 0; i < get_shared_state()->m_mapped_buffers.size(); i++)
+                vogl_mapped_buffer_desc_vec &mapped_bufs = get_shared_state()->m_shadow_state.m_mapped_buffers;
+
+                for (uint i = 0; i < mapped_bufs.size(); i++)
                 {
-                    if (get_shared_state()->m_mapped_buffers[i].m_buffer == replay_id)
+                    if (mapped_bufs[i].m_buffer == replay_id)
                     {
                         process_entrypoint_warning("%s: glDeleteBuffers() called on mapped trace buffer %u GL buffer %u\n", VOGL_METHOD_NAME, trace_id, replay_id);
 
-                        get_shared_state()->m_mapped_buffers.erase_unordered(i);
+                        mapped_bufs.erase_unordered(i);
                         break;
                     }
                 }
@@ -7048,14 +7057,16 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
             GLuint buffer = vogl_get_bound_gl_buffer(target);
             if (buffer)
             {
+                vogl_mapped_buffer_desc_vec &mapped_bufs = get_shared_state()->m_shadow_state.m_mapped_buffers;
+
                 uint i;
-                for (i = 0; i < get_shared_state()->m_mapped_buffers.size(); i++)
+                for (i = 0; i < mapped_bufs.size(); i++)
                 {
-                    if (get_shared_state()->m_mapped_buffers[i].m_buffer == buffer)
+                    if (mapped_bufs[i].m_buffer == buffer)
                     {
                         process_entrypoint_warning("%s: glBufferData() called on already mapped GL buffer %u, assuming GL will be unmapping it\n", VOGL_METHOD_NAME, buffer);
 
-                        get_shared_state()->m_mapped_buffers.erase_unordered(i);
+                        mapped_bufs.erase_unordered(i);
                         break;
                     }
                 }
@@ -7087,22 +7098,24 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
 
                 GLuint buffer = vogl_get_bound_gl_buffer(target);
 
+                vogl_mapped_buffer_desc_vec &mapped_bufs = get_shared_state()->m_shadow_state.m_mapped_buffers;
+
                 uint i;
-                for (i = 0; i < get_shared_state()->m_mapped_buffers.size(); i++)
+                for (i = 0; i < mapped_bufs.size(); i++)
                 {
-                    if (get_shared_state()->m_mapped_buffers[i].m_buffer == buffer)
+                    if (mapped_bufs[i].m_buffer == buffer)
                     {
                         process_entrypoint_error("%s: Buffer %u is already mapped\n", VOGL_METHOD_NAME, buffer);
                         return cStatusHardFailure;
                     }
                 }
 
-                if (i == get_shared_state()->m_mapped_buffers.size())
+                if (i == mapped_bufs.size())
                 {
                     GLint length = 0;
                     GL_ENTRYPOINT(glGetBufferParameteriv)(target, GL_BUFFER_SIZE, &length);
 
-                    mapped_buffer_desc m;
+                    vogl_mapped_buffer_desc m;
                     m.m_buffer = buffer;
                     m.m_target = target;
                     m.m_offset = 0;
@@ -7110,7 +7123,7 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
                     m.m_access = access;
                     m.m_range = false;
                     m.m_pPtr = pMap;
-                    get_shared_state()->m_mapped_buffers.push_back(m);
+                    mapped_bufs.push_back(m);
                 }
             }
 
@@ -7145,20 +7158,22 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
                     return cStatusHardFailure;
                 }
 
+                vogl_mapped_buffer_desc_vec &mapped_bufs = get_shared_state()->m_shadow_state.m_mapped_buffers;
+
                 GLuint buffer = vogl_get_bound_gl_buffer(target);
                 uint i;
-                for (i = 0; i < get_shared_state()->m_mapped_buffers.size(); i++)
+                for (i = 0; i < mapped_bufs.size(); i++)
                 {
-                    if (get_shared_state()->m_mapped_buffers[i].m_buffer == buffer)
+                    if (mapped_bufs[i].m_buffer == buffer)
                     {
                         process_entrypoint_error("%s: Buffer %u is already mapped\n", VOGL_METHOD_NAME, buffer);
                         return cStatusHardFailure;
                     }
                 }
 
-                if (i == get_shared_state()->m_mapped_buffers.size())
+                if (i == mapped_bufs.size())
                 {
-                    mapped_buffer_desc m;
+                    vogl_mapped_buffer_desc m;
                     m.m_buffer = buffer;
                     m.m_target = target;
                     m.m_offset = offset;
@@ -7166,7 +7181,7 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
                     m.m_access = access;
                     m.m_range = true;
                     m.m_pPtr = pMap;
-                    get_shared_state()->m_mapped_buffers.push_back(m);
+                    mapped_bufs.push_back(m);
                 }
             }
 
@@ -7188,17 +7203,19 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
             // FIXME - must call GL even if !buffer
             if (buffer)
             {
+                vogl_mapped_buffer_desc_vec &mapped_bufs = get_shared_state()->m_shadow_state.m_mapped_buffers;
+
                 uint mapped_buffers_index;
-                for (mapped_buffers_index = 0; mapped_buffers_index < get_shared_state()->m_mapped_buffers.size(); mapped_buffers_index++)
-                    if (get_shared_state()->m_mapped_buffers[mapped_buffers_index].m_buffer == buffer)
+                for (mapped_buffers_index = 0; mapped_buffers_index < mapped_bufs.size(); mapped_buffers_index++)
+                    if (mapped_bufs[mapped_buffers_index].m_buffer == buffer)
                         break;
-                if (mapped_buffers_index == get_shared_state()->m_mapped_buffers.size())
+                if (mapped_buffers_index == mapped_bufs.size())
                 {
                     process_entrypoint_error("%s: Unable to find mapped buffer during unmap\n", VOGL_METHOD_NAME);
                     return cStatusHardFailure;
                 }
 
-                mapped_buffer_desc &map_desc = get_shared_state()->m_mapped_buffers[mapped_buffers_index];
+                vogl_mapped_buffer_desc &map_desc = mapped_bufs[mapped_buffers_index];
 
                 bool writable_map = false;
                 bool explicit_bit = false;
@@ -7264,7 +7281,7 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
                     }
                 }
 
-                get_shared_state()->m_mapped_buffers.erase_unordered(mapped_buffers_index);
+                get_shared_state()->m_shadow_state.m_mapped_buffers.erase_unordered(mapped_buffers_index);
             }
 
             GLboolean replay_result;
@@ -8436,6 +8453,272 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern
             // TODO
             break;
         }
+        case VOGL_ENTRYPOINT_glBitmap:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glBitmap;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(6);
+                pTrace_bitmap = (const GLubyte *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glBitmap;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glColorSubTable:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glColorSubTable;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(5);
+                pTrace_data = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glColorSubTable;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glColorSubTableEXT:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glColorSubTableEXT;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(5);
+                pTrace_data = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glColorSubTableEXT;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glColorTable:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glColorTable;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(5);
+                pTrace_table = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glColorTable;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glColorTableEXT:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glColorTableEXT;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(5);
+                pTrace_table = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glColorTableEXT;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glConvolutionFilter1D:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glConvolutionFilter1D;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(5);
+                pTrace_image = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glConvolutionFilter1D;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glConvolutionFilter2D:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glConvolutionFilter2D;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(6);
+                pTrace_image = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glConvolutionFilter2D;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glDrawPixels:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glDrawPixels;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(4);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glDrawPixels;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glPolygonStipple:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glPolygonStipple;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(0);
+                pTrace_mask = (const GLubyte *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glPolygonStipple;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexImage1D:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexImage1D;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(7);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexImage1D;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexImage2D:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexImage2D;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(8);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexImage2D;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexImage3D:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexImage3D;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(9);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexImage3D;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexImage3DEXT:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexImage3DEXT;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(9);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexImage3DEXT;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexSubImage1D:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexSubImage1D;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(6);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexSubImage1D;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexSubImage1DEXT:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexSubImage1DEXT;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(6);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexSubImage1DEXT;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexSubImage2D:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexSubImage2D;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(8);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexSubImage2D;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexSubImage2DEXT:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexSubImage2DEXT;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(8);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexSubImage2DEXT;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexSubImage3D:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexSubImage3D;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(10);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexSubImage3D;
+
+            break;
+        }
+        case VOGL_ENTRYPOINT_glTexSubImage3DEXT:
+        {
+            VOGL_REPLAY_LOAD_PARAMS_HELPER_glTexSubImage3DEXT;
+
+            if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            {
+                vogl_trace_ptr_value ptr_val = trace_packet.get_param_ptr_value(10);
+                pTrace_pixels = (const GLvoid *)ptr_val;
+            }
+
+            VOGL_REPLAY_CALL_GL_HELPER_glTexSubImage3DEXT;
+
+            break;
+        }
         case VOGL_ENTRYPOINT_glAreTexturesResident:
         case VOGL_ENTRYPOINT_glAreTexturesResidentEXT:
         case VOGL_ENTRYPOINT_glGetActiveAtomicCounterBufferiv:
@@ -9065,10 +9348,11 @@ uint64_t vogl_gl_replayer::replay_to_trace_handle_remapper::remap_handle(vogl_na
         }
     }
 
-    VOGL_ASSERT_ALWAYS;
-
+    // This is BAD.
     vogl_error_printf("%s: Failed remapping handle %" PRIu64 " in namespace %s. This is either a handle shadowing bug, or this object was deleted while it was still bound on another context or attached to an object.\n", VOGL_METHOD_NAME, replay_handle, vogl_get_namespace_name(handle_namespace));
 
+    VOGL_ASSERT_ALWAYS;
+
     return replay_handle;
 }
 
@@ -9315,11 +9599,6 @@ vogl_gl_state_snapshot *vogl_gl_replayer::snapshot_state(const vogl_trace_packet
                 pSnapshot->set_is_restorable(false);
             }
 
-            if (get_shared_state()->m_mapped_buffers.size())
-            {
-                vogl_warning_printf("%s: Trace context 0x%" PRIX64 " has %u currently mapped GL buffers, this scenario is not currently unsupported for state capturing. Capture will continue but will not be replayable.\n", VOGL_METHOD_NAME, cast_val_to_uint64(it->first), get_shared_state()->m_mapped_buffers.size());
-                pSnapshot->set_is_restorable(false);
-            }
 
             // Init the shadow state needed by the snapshot code.
             if (!m_pCur_context_state->is_root_context())
@@ -9405,14 +9684,75 @@ vogl_gl_state_snapshot *vogl_gl_replayer::snapshot_state(const vogl_trace_packet
                     GLenum target = arb_prog_it->second;
                     pShadow_state->m_arb_program_targets.insert(replay_handle, target);
                 }
-            }
-        }
+
+                // Deal with any currently mapped buffers.
+                vogl_mapped_buffer_desc_vec &mapped_bufs = get_shared_state()->m_shadow_state.m_mapped_buffers;
+
+                pShadow_state->m_mapped_buffers = mapped_bufs;
+
+                if (mapped_bufs.size())
+                {
+                    vogl_warning_printf("%s: %u buffer(s) are currently mapped, these will be temporarily unmapped in order to snapshot them and then remapped\n", VOGL_METHOD_NAME, m_pCur_context_state->m_shadow_state.m_mapped_buffers.size());
+
+                    for (uint i = 0; i < mapped_bufs.size(); i++)
+                    {
+                        vogl_mapped_buffer_desc &desc = mapped_bufs[i];
+
+                        GLuint prev_handle = vogl_get_bound_gl_buffer(desc.m_target);
+
+                        GL_ENTRYPOINT(glBindBuffer)(desc.m_target, desc.m_buffer);
+                        VOGL_CHECK_GL_ERROR;
+
+                        GL_ENTRYPOINT(glUnmapBuffer)(desc.m_target);
+                        VOGL_CHECK_GL_ERROR;
+
+                        desc.m_pPtr = NULL;
+
+                        GL_ENTRYPOINT(glBindBuffer)(desc.m_target, prev_handle);
+                        VOGL_CHECK_GL_ERROR;
+                    }
+                }
+
+            } // if (!m_pCur_context_state->is_root_context())
+
+        } // if (pContext_state->m_has_been_made_current)
 
         if (!pSnapshot->capture_context(pContext_state->m_context_desc, pContext_state->m_context_info, m_replay_to_trace_remapper, *pShadow_state))
         {
             vogl_error_printf("%s: Failed capturing trace context 0x%" PRIX64 ", capture failed\n", VOGL_METHOD_NAME, static_cast<uint64_t>(it->first));
             break;
         }
+
+        if ((pContext_state->m_has_been_made_current) && (m_pCur_context_state->is_root_context()))
+        {
+            vogl_mapped_buffer_desc_vec &mapped_bufs = get_shared_state()->m_shadow_state.m_mapped_buffers;
+
+            // Now remap any mapped buffers
+            for (uint i = 0; i < mapped_bufs.size(); i++)
+            {
+                vogl_mapped_buffer_desc &desc = mapped_bufs[i];
+
+                GLuint prev_handle = vogl_get_bound_gl_buffer(desc.m_target);
+
+                GL_ENTRYPOINT(glBindBuffer)(desc.m_target, desc.m_buffer);
+                VOGL_CHECK_GL_ERROR;
+
+                if (desc.m_range)
+                {
+                    desc.m_pPtr = GL_ENTRYPOINT(glMapBufferRange)(desc.m_target, static_cast<GLintptr>(desc.m_offset), static_cast<GLsizeiptr>(desc.m_length), desc.m_access);
+                    VOGL_CHECK_GL_ERROR;
+                }
+                else
+                {
+                    desc.m_pPtr = GL_ENTRYPOINT(glMapBuffer)(desc.m_target, desc.m_access);
+                    VOGL_CHECK_GL_ERROR;
+                }
+
+                GL_ENTRYPOINT(glBindBuffer)(desc.m_target, prev_handle);
+                VOGL_CHECK_GL_ERROR;
+
+            }
+        }
     }
 
     if ((it == m_contexts.end()) && (pSnapshot->end_capture()))
@@ -10058,6 +10398,46 @@ vogl_gl_replayer::status_t vogl_gl_replayer::restore_objects(
 
                 break;
             }
+            case cGLSTBuffer:
+            {
+                const vogl_buffer_state *pBuf = static_cast<const vogl_buffer_state *>(pState_obj);
+
+                // Check if the buffer was mapped during the snapshot, if so remap it and record the ptr in the replayer's context shadow.
+                if (pBuf->get_is_mapped())
+                {
+                    vogl_mapped_buffer_desc map_desc;
+                    map_desc.m_buffer = static_cast<GLuint>(restore_handle);
+                    map_desc.m_target = pBuf->get_target();
+                    map_desc.m_offset = pBuf->get_map_ofs();
+                    map_desc.m_length = pBuf->get_map_size();
+                    map_desc.m_access = pBuf->get_map_access();
+                    map_desc.m_range = pBuf->get_is_map_range();
+
+                    GLuint prev_handle = vogl_get_bound_gl_buffer(map_desc.m_target);
+
+                    GL_ENTRYPOINT(glBindBuffer)(map_desc.m_target, map_desc.m_buffer);
+                    VOGL_CHECK_GL_ERROR;
+
+                    if (map_desc.m_range)
+                    {
+                        map_desc.m_pPtr = GL_ENTRYPOINT(glMapBufferRange)(map_desc.m_target, static_cast<GLintptr>(map_desc.m_offset), static_cast<GLintptr>(map_desc.m_length), map_desc.m_access);
+                        VOGL_CHECK_GL_ERROR;
+                    }
+                    else
+                    {
+                        map_desc.m_pPtr = GL_ENTRYPOINT(glMapBuffer)(map_desc.m_target, map_desc.m_access);
+                        VOGL_CHECK_GL_ERROR;
+                    }
+
+                    GL_ENTRYPOINT(glBindBuffer)(map_desc.m_target, prev_handle);
+                    VOGL_CHECK_GL_ERROR;
+
+                    vogl_mapped_buffer_desc_vec &mapped_bufs = get_shared_state()->m_shadow_state.m_mapped_buffers;
+                    mapped_bufs.push_back(map_desc);
+                }
+
+                break;
+            }
             default:
                 break;
         }
@@ -10162,98 +10542,95 @@ vogl_gl_replayer::status_t vogl_gl_replayer::restore_display_lists(vogl_handle_r
             continue;
         }
 
-        if (!disp_list.is_valid())
-        {
-            VOGL_ASSERT_ALWAYS;
-            continue;
-        }
-
         GLuint replay_handle = GL_ENTRYPOINT(glGenLists)(1);
         if (check_gl_error() || !replay_handle)
             goto handle_failure;
 
-        if (disp_list.is_xfont())
+        if (disp_list.is_valid())
         {
-            XFontStruct *pXFont = xfont_cache.get_or_create(disp_list.get_xfont_name().get_ptr());
-            if (!pXFont)
+            if (disp_list.is_xfont())
             {
-                vogl_error_printf("%s: Unable to load XFont \"%s\", can't recreate trace display list %u!\n", VOGL_METHOD_NAME, disp_list.get_xfont_name().get_ptr(), trace_handle);
+                XFontStruct *pXFont = xfont_cache.get_or_create(disp_list.get_xfont_name().get_ptr());
+                if (!pXFont)
+                {
+                    vogl_error_printf("%s: Unable to load XFont \"%s\", can't recreate trace display list %u!\n", VOGL_METHOD_NAME, disp_list.get_xfont_name().get_ptr(), trace_handle);
+                }
+                else
+                {
+                    GL_ENTRYPOINT(glXUseXFont)(pXFont->fid, disp_list.get_xfont_glyph(), 1, replay_handle);
+                }
             }
             else
             {
-                GL_ENTRYPOINT(glXUseXFont)(pXFont->fid, disp_list.get_xfont_glyph(), 1, replay_handle);
-            }
-        }
-        else
-        {
-            GL_ENTRYPOINT(glNewList)(replay_handle, GL_COMPILE);
+                GL_ENTRYPOINT(glNewList)(replay_handle, GL_COMPILE);
 
-            if (check_gl_error() || !replay_handle)
-            {
-                GL_ENTRYPOINT(glDeleteLists)(replay_handle, 1);
-                check_gl_error();
+                if (check_gl_error() || !replay_handle)
+                {
+                    GL_ENTRYPOINT(glDeleteLists)(replay_handle, 1);
+                    check_gl_error();
 
-                goto handle_failure;
-            }
+                    goto handle_failure;
+                }
 
-            const vogl_trace_packet_array &packets = disp_list.get_packets();
+                const vogl_trace_packet_array &packets = disp_list.get_packets();
 
-            for (uint packet_index = 0; packet_index < packets.size(); packet_index++)
-            {
-                if (packets.get_packet_type(packet_index) != cTSPTGLEntrypoint)
+                for (uint packet_index = 0; packet_index < packets.size(); packet_index++)
                 {
-                    vogl_error_printf("%s: Unexpected display list packet type %u, packet index %u, can't fully recreate trace display list %u!\n", VOGL_METHOD_NAME, packets.get_packet_type(packet_index), packet_index, trace_handle);
-                    continue;
-                }
+                    if (packets.get_packet_type(packet_index) != cTSPTGLEntrypoint)
+                    {
+                        vogl_error_printf("%s: Unexpected display list packet type %u, packet index %u, can't fully recreate trace display list %u!\n", VOGL_METHOD_NAME, packets.get_packet_type(packet_index), packet_index, trace_handle);
+                        continue;
+                    }
 
-                const uint8_vec &packet_buf = packets.get_packet_buf(packet_index);
+                    const uint8_vec &packet_buf = packets.get_packet_buf(packet_index);
 
-                if (!m_temp2_gl_packet.deserialize(packet_buf, true))
-                {
-                    vogl_error_printf("%s: Failed deserializing display list at packet index %u, can't fully recreate trace display list %u!\n", VOGL_METHOD_NAME, packet_index, trace_handle);
-                    continue;
-                }
+                    if (!m_temp2_gl_packet.deserialize(packet_buf, true))
+                    {
+                        vogl_error_printf("%s: Failed deserializing display list at packet index %u, can't fully recreate trace display list %u!\n", VOGL_METHOD_NAME, packet_index, trace_handle);
+                        continue;
+                    }
 
-                vogl_trace_gl_entrypoint_packet &gl_entrypoint_packet = m_temp2_gl_packet.get_entrypoint_packet();
+                    vogl_trace_gl_entrypoint_packet &gl_entrypoint_packet = m_temp2_gl_packet.get_entrypoint_packet();
 
-                gl_entrypoint_packet.m_context_handle = m_cur_trace_context;
+                    gl_entrypoint_packet.m_context_handle = m_cur_trace_context;
 
-                if (m_flags & cGLReplayerDebugMode)
-                    dump_trace_gl_packet_debug_info(gl_entrypoint_packet);
+                    if (m_flags & cGLReplayerDebugMode)
+                        dump_trace_gl_packet_debug_info(gl_entrypoint_packet);
 
-                int64_t prev_parsed_call_counter = m_last_parsed_call_counter;
-                int64_t prev_processed_call_counter = m_last_processed_call_counter;
-                m_last_parsed_call_counter = gl_entrypoint_packet.m_call_counter;
-                m_last_processed_call_counter = gl_entrypoint_packet.m_call_counter;
-                bool prev_at_frame_boundary = m_at_frame_boundary;
+                    int64_t prev_parsed_call_counter = m_last_parsed_call_counter;
+                    int64_t prev_processed_call_counter = m_last_processed_call_counter;
+                    m_last_parsed_call_counter = gl_entrypoint_packet.m_call_counter;
+                    m_last_processed_call_counter = gl_entrypoint_packet.m_call_counter;
+                    bool prev_at_frame_boundary = m_at_frame_boundary;
 
-                const vogl_trace_packet *pPrev_gl_packet = m_pCur_gl_packet;
+                    const vogl_trace_packet *pPrev_gl_packet = m_pCur_gl_packet;
 
-                m_pCur_gl_packet = &m_temp2_gl_packet;
+                    m_pCur_gl_packet = &m_temp2_gl_packet;
 
-                vogl_gl_replayer::status_t status = process_gl_entrypoint_packet_internal(m_temp2_gl_packet);
+                    vogl_gl_replayer::status_t status = process_gl_entrypoint_packet_internal(m_temp2_gl_packet);
 
-                m_pCur_gl_packet = pPrev_gl_packet;
+                    m_pCur_gl_packet = pPrev_gl_packet;
 
-                m_last_parsed_call_counter = prev_parsed_call_counter;
-                m_last_processed_call_counter = prev_processed_call_counter;
-                m_at_frame_boundary = prev_at_frame_boundary;
+                    m_last_parsed_call_counter = prev_parsed_call_counter;
+                    m_last_processed_call_counter = prev_processed_call_counter;
+                    m_at_frame_boundary = prev_at_frame_boundary;
 
-                if (status != cStatusOK)
+                    if (status != cStatusOK)
+                    {
+                        vogl_error_printf("%s: Failed recreating display list at packet index %u, can't fully recreate trace display list %u!\n", VOGL_METHOD_NAME, packet_index, trace_handle);
+                        continue;
+                    }
+                }
+
+                // TODO: Set context state because we're currently generating a display list!
+                if (disp_list.is_generating())
                 {
-                    vogl_error_printf("%s: Failed recreating display list at packet index %u, can't fully recreate trace display list %u!\n", VOGL_METHOD_NAME, packet_index, trace_handle);
-                    continue;
+                    VOGL_ASSERT_ALWAYS;
                 }
-            }
 
-            // TODO: Set context state because we're currently generating a display list!
-            if (disp_list.is_generating())
-            {
-                VOGL_ASSERT_ALWAYS;
+                GL_ENTRYPOINT(glEndList)();
+                check_gl_error();
             }
-
-            GL_ENTRYPOINT(glEndList)();
-            check_gl_error();
         }
 
         get_shared_state()->m_lists.insert(trace_handle, replay_handle);
@@ -11163,5 +11540,13 @@ bool vogl_gl_replayer::write_trim_file(uint flags, const dynamic_string &trim_fi
         }
     }
 
-    return write_trim_file_internal(trim_packets, trim_filename, trace_reader, (flags & cWriteTrimFileOptimizeSnapshot) != 0, pSnapshot_id);
+    if (!write_trim_file_internal(trim_packets, trim_filename, trace_reader, (flags & cWriteTrimFileOptimizeSnapshot) != 0, pSnapshot_id))
+    {
+        console::warning("%s: Trim file write failed, deleting invalid trim trace file %s\n", VOGL_METHOD_NAME, trim_filename.get_ptr());
+
+        file_utils::delete_file(trim_filename.get_ptr());
+        return false;
+    }
+
+    return true;
 }
index 071f953bfd851eef969b70c6a2abf49f747d2638..4d15b54a001f6c4bb920b3f50691b00194622525 100644 (file)
@@ -344,17 +344,6 @@ private:
     };
     typedef vogl::hash_map<GLuint, glsl_program_state> glsl_program_hash_map;
 
-    struct mapped_buffer_desc
-    {
-        GLuint m_buffer;
-        GLenum m_target;
-        vogl_trace_ptr_value m_offset;
-        vogl_trace_ptr_value m_length;
-        GLbitfield m_access;
-        bool m_range;
-        void *m_pPtr;
-    };
-
     class context_state
     {
         VOGL_NO_COPY_OR_ASSIGNMENT_OP(context_state);
@@ -441,8 +430,6 @@ private:
         GLuint m_cur_replay_program;
         GLuint m_cur_trace_program;
 
-        vogl::vector<mapped_buffer_desc> m_mapped_buffers;
-
         vogl::vector<GLfloat> m_feedback_buffer;
         vogl::vector<GLuint> m_select_buffer;
 
index cabeeac04b35b31bc15a4ab10fbb6120c36729f0..e23f81161757882ca16233edce363083b5c592a5 100644 (file)
@@ -375,6 +375,23 @@ bool vogl_context_snapshot::capture_objects(vogl_gl_object_state_type state_type
                     vogl_error_printf("%s: GL program %u was snapshotted with a successful link status, but the link snapshot shadow doesn't contain this program!\n", VOGL_METHOD_NAME, handle);
                 }
             }
+            else if (state_type == cGLSTBuffer)
+            {
+                // Determine if this buffer has been mapped. I don't expect this array to be very big (typically empty) so a simple search is fine.
+                uint j;
+                for (j = 0; j < capture_params.m_mapped_buffers.size(); j++)
+                    if (capture_params.m_mapped_buffers[j].m_buffer == handle)
+                        break;
+
+                if (j < capture_params.m_mapped_buffers.size())
+                {
+                    const vogl_mapped_buffer_desc &map_desc = capture_params.m_mapped_buffers[j];
+
+                    vogl_buffer_state *pBuf_state = static_cast<vogl_buffer_state *>(p);
+
+                    pBuf_state->set_mapped_buffer_snapshot_state(map_desc);
+                }
+            }
 
             m_object_ptrs.push_back(p);
             total++;
@@ -702,7 +719,7 @@ bool vogl_gl_state_snapshot::capture_context(
             vogl_error_printf("%s: Failed snapshotting default framebuffer!\n", VOGL_METHOD_NAME);
         }
 
-        m_captured_default_framebuffer = false;
+        m_captured_default_framebuffer = true;
     }
 
     vogl_context_snapshot *pSnapshot = vogl_new(vogl_context_snapshot);
index ad054dbdfd4d8001c188a5e0ac63d8f5dfaca7ad..664feb1284ae861f63903954fd085ee3244fb45c 100644 (file)
@@ -79,6 +79,33 @@ inline uint64_t vogl_sync_to_handle(GLsync sync)
     return handle;
 }
 
+//----------------------------------------------------------------------------------------------------------------------
+// struct vogl_mapped_buffer_desc
+//----------------------------------------------------------------------------------------------------------------------
+struct vogl_mapped_buffer_desc
+{
+    // Handles and ptrs here are in the replay/GL domain
+    GLuint m_buffer;
+    GLenum m_target;
+    vogl_trace_ptr_value m_offset;
+    vogl_trace_ptr_value m_length;
+    GLbitfield m_access;
+    bool m_range;
+    void *m_pPtr;
+
+    vogl_mapped_buffer_desc()
+    {
+        clear();
+    }
+
+    void clear()
+    {
+        memset(this, 0, sizeof(*this));
+    }
+};
+
+typedef vogl::vector<vogl_mapped_buffer_desc> vogl_mapped_buffer_desc_vec;
+
 //----------------------------------------------------------------------------------------------------------------------
 // class vogl_capture_context_params
 // TODO: Rename this to vogl_context_state_shadow?
@@ -133,6 +160,7 @@ public:
 
     // During replay: replay domain
     vogl_linked_program_state m_linked_programs;
+    vogl_mapped_buffer_desc_vec m_mapped_buffers;
 
     // During replay: These objects map from trace (non-inv) to replay (inv).
     // TODO: Transition ALL the above hash sets/maps to instances of vogl_handle_tracker.
index 02f002dc7424725895580faa66b9f5b613eeb320..b80f3d7a77f06358d31291ebe94afc7553b60ed8 100644 (file)
@@ -478,6 +478,9 @@ size_t vogl_get_image_size(GLenum format, GLenum type, GLsizei width, GLsizei he
     GLint skip_pixels = vogl_get_gl_integer(GL_UNPACK_SKIP_PIXELS);
     GLint skip_images = vogl_get_gl_integer(GL_UNPACK_SKIP_IMAGES);
 
+    //printf("format: 0x%X type: 0x%X width: %i height: %i depth: %i alignment: %i row_length: %i image_height: %i skip_rows: %i skip_pixels: %i skip_images: %i\n",
+    //       format, type, (int)width, (int)height, (int)depth, alignment, row_length, image_height, skip_rows, skip_pixels, skip_images);
+
     if (row_length <= 0)
     {
         row_length = width;
index b29838425769943457835fdcb9e1e0ff1dcba8cf..51f01654f60d073be2ced3bb19a0fd6e22245170 100644 (file)
@@ -3080,48 +3080,82 @@ static inline bool vogl_func_is_nulled(gl_entrypoint_id_t id)
 
 //----------------------------------------------------------------------------------------------------------------------
 // Texture/image API's array size helper macros
+// TODO: For glTexImage3DEXT, glTexSubImage1DEXT, etc. - should these check the currently bound GL_PIXEL_UNPACK_BUFFER?
 //----------------------------------------------------------------------------------------------------------------------
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexImage1D_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexImage2D_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexImage3D_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, depth)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, depth)
+size_t vogl_calc_set_tex_image_serialize_size(vogl_context *pContext, GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth)
+{
+    if (pContext)
+    {
+        if (vogl_get_bound_gl_buffer(GL_PIXEL_UNPACK_BUFFER))
+            return 0;
+    }
+
+    return vogl_get_image_size(format, type, width, height, depth);
+}
+
+size_t vogl_calc_get_tex_image_serialize_size(vogl_context *pContext, GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth)
+{
+    if (pContext)
+    {
+        if (vogl_get_bound_gl_buffer(GL_PIXEL_PACK_BUFFER))
+            return 0;
+    }
+
+    return vogl_get_image_size(format, type, width, height, depth);
+}
+
+size_t vogl_calc_get_tex_target_serialize_size(vogl_context *pContext, GLenum target, GLint level, GLenum format, GLenum type)
+{
+    if (pContext)
+    {
+        if (vogl_get_bound_gl_buffer(GL_PIXEL_PACK_BUFFER))
+            return 0;
+    }
+
+    return vogl_get_tex_target_image_size(target, level, format, type);
+}
+
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexImage1D_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexImage2D_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexImage3D_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, depth)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, depth)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage1D_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage1D_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage2D_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage2D_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage3D_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, depth)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, depth)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage3D_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, depth)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTexSubImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, depth)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, depth)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, depth)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureSubImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, depth)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureSubImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureSubImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureSubImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, depth)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureSubImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glTextureSubImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, depth)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, depth)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexSubImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, depth)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexSubImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexSubImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexSubImage3DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, depth)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexSubImage2DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glMultiTexSubImage1DEXT_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glDrawPixels_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glConvolutionFilter1D_image(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glConvolutionFilter2D_image(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glDrawPixels_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glConvolutionFilter1D_image(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glConvolutionFilter2D_image(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, height, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glColorTable_table(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glColorSubTable_data(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, count, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glColorTable_table(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glColorSubTable_data(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, count, 1, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glBitmap_size(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(GL_COLOR_INDEX, GL_BITMAP, width, height, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glPolygonStipple_mask(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(GL_COLOR_INDEX, GL_BITMAP, 32, 32, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glBitmap_size(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, GL_COLOR_INDEX, GL_BITMAP, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glPolygonStipple_mask(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, GL_COLOR_INDEX, GL_BITMAP, 32, 32, 1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glGetTexImage_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_tex_target_image_size(target, level, format, type)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glGetTexImage_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_get_tex_target_serialize_size(pContext, target, level, format, type)
 
 #define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glStringMarkerGREMEDY_string(e, c, rt, r, nu, ne, a, p) ((string) ? (!(len) ? (strlen(static_cast<const char *>(string)) + 1) : (len)) : 0)
 
@@ -3132,13 +3166,13 @@ static inline bool vogl_func_is_nulled(gl_entrypoint_id_t id)
 #define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glGetActiveAttrib_name(e, c, rt, r, nu, ne, a, p) ((name) ? (strlen((const char *)(name)) + 1) : -1)
 #define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glGetActiveAttribARB_name(e, c, rt, r, nu, ne, a, p) ((name) ? (strlen((const char *)(name)) + 1) : -1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glReadPixels_pixels(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glReadPixels_pixels(e, c, rt, r, nu, ne, a, p) vogl_calc_get_tex_image_serialize_size(pContext, format, type, width, height, 1)
 
 #define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glBindFragDataLocationIndexed_name(e, c, rt, r, nu, ne, a, p) (name ? (strlen((const char *)(name)) + 1) : -1)
 #define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glBindFragDataLocation_name(e, c, rt, r, nu, ne, a, p) (name ? (strlen((const char *)(name)) + 1) : -1)
 #define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glBindFragDataLocationEXT_name(e, c, rt, r, nu, ne, a, p) (name ? (strlen((const char *)(name)) + 1) : -1)
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glBitmap_bitmap(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(GL_COLOR_INDEX, GL_BITMAP, width, height, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glBitmap_bitmap(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, GL_COLOR_INDEX, GL_BITMAP, width, height, 1)
 
 #define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glGetActiveUniform_name(e, c, rt, r, nu, ne, a, p) ((name) ? ((length) ? (*(length) + 1) : (bufSize)) : -1)
 
@@ -3161,8 +3195,8 @@ static GLsizei vogl_compute_message_log_size_in_bytes(GLuint count, const GLsize
     return total_length;
 }
 
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glSeparableFilter2D_row(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, width, 1, 1)
-#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glSeparableFilter2D_column(e, c, rt, r, nu, ne, a, p) vogl_get_image_size(format, type, height, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glSeparableFilter2D_row(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, width, 1, 1)
+#define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glSeparableFilter2D_column(e, c, rt, r, nu, ne, a, p) vogl_calc_set_tex_image_serialize_size(pContext, format, type, height, 1, 1)
 
 // TODO - These are all gets, so they aren't completely necessary for proper replaying because they have no side effects (except for possibly glError's).
 #define DEF_FUNCTION_PARAM_COMPUTE_ARRAY_SIZE_FUNC_glGetUniformfv_params(e, c, rt, r, nu, ne, a, p) -1
@@ -6232,7 +6266,6 @@ static inline void vogl_multi_draw_arrays_helper(
 static void vogl_multi_draw_elements_helper(
     vogl_context *pContext, vogl_entrypoint_serializer &trace_serializer, const char *pFunc)
 {
-    // HACK HACK
     if (trace_serializer.is_in_begin())
     {
         if (vogl_uses_client_side_arrays(pContext, true))