]> git.cworth.org Git - vogl/commitdiff
- Fixing restore of indexed uniform buffer bindings
authorRich Geldreich <richgel99@gmail.com>
Tue, 25 Mar 2014 11:20:43 +0000 (04:20 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 1 Apr 2014 19:37:32 +0000 (12:37 -0700)
- Fixing remapping of uniform locations when the compiler assigns different locations on restore vs. tracing
- Fixing strange crash in editor

src/voglcommon/vogl_general_context_state.cpp
src/voglcommon/vogl_gl_replayer.cpp
src/voglcommon/vogl_program_state.cpp
src/vogleditor/vogleditor_statetreetextureitem.cpp

index 94a71891d919d5790602bc04e8437133d7163024..45c96b755f3f18d7fb087c1b72461c09f7582ba1 100644 (file)
@@ -333,7 +333,7 @@ bool vogl_general_context_state::restore_buffer_binding(GLenum binding_enum, GLe
     VOGL_FUNC_TRACER
 
     uint buffer = 0;
-    if (get(binding_enum, 0, &buffer))
+    if (get(binding_enum, 0, &buffer, 1, false))
     {
         buffer = static_cast<uint>(remapper.remap_handle(VOGL_NAMESPACE_BUFFERS, buffer));
 
@@ -355,9 +355,9 @@ bool vogl_general_context_state::restore_buffer_binding_range(GLenum binding_enu
 
     uint64_t start, size = 0;
     uint buffer = 0;
-    if (get(binding_enum, index, &buffer, indexed_variant) &&
-        get(start_enum, index, &start, indexed_variant) &&
-        get(size_enum, index, &size, indexed_variant))
+    if (get(binding_enum, index, &buffer, 1, indexed_variant) &&
+        get(start_enum, index, &start, 1, indexed_variant) &&
+        get(size_enum, index, &size, 1, indexed_variant))
     {
         if (buffer)
         {
index 454bd98d0d14b23e228a2a64e63ff9473c390577..e5023c7e3e156a3cd36a5d738d7309147467b0d3 100644 (file)
@@ -10446,6 +10446,8 @@ void vogl_gl_replayer::trace_to_replay_handle_remapper::delete_handle_and_object
 
 //----------------------------------------------------------------------------------------------------------------------
 // vogl_replayer::trace_to_replay_handle_remapper::declare_location
+// from_location - trace location
+// to_location - replay/GL location
 //----------------------------------------------------------------------------------------------------------------------
 void vogl_gl_replayer::trace_to_replay_handle_remapper::declare_location(uint32 from_program_handle, uint32 to_program_handle, int32 from_location, int32 to_location)
 {
index bfc8a99f094ffeaa084db2697cf5a0970a96750a..5998a4149bd4e175d07a2c4d6a205ce91ecea702 100644 (file)
@@ -779,7 +779,7 @@ bool vogl_program_state::restore_uniforms(uint32 handle32, const vogl_context_in
         const GLint restore_location = restore_uniform.m_base_location;
 
         for (uint i = 0; i < array_size; i++)
-            remapper.declare_location(m_snapshot_handle, handle32, restore_uniform.m_base_location + i, restore_location + i);
+            remapper.declare_location(m_snapshot_handle, handle32, trace_uniform.m_base_location + i, restore_location + i);
 
         if (array_size)
         {
index 25ffb6ef5a37a3f27a34f51063c8d87a32fee8fa..e86045a3ba92e84795b380d34ee595b7b36f5dd3 100644 (file)
@@ -23,9 +23,9 @@ vogleditor_stateTreeTextureItem::vogleditor_stateTreeTextureItem(QString name, Q
 #define STR_INT1(val) tmp.sprintf("%d", val[0])
 
 
-#define GET_INT(name, num) if (m_pTexture->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecIntItem* pItem = new vogleditor_stateTreeStateVecIntItem(#name, name, 0, m_pTexture->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
-#define GET_ENUM(name, num) if (m_pTexture->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecEnumItem* pItem = new vogleditor_stateTreeStateVecEnumItem(#name, name, 0, m_pTexture->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
-#define GET_FLOAT(name, num) if (m_pTexture->get_params().get<float>(name, 0, fVals, num)) { vogleditor_stateTreeStateVecFloatItem* pItem = new vogleditor_stateTreeStateVecFloatItem(#name, name, 0, m_pTexture->get_params(), fVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
+#define GET_INT(name, num) memset(iVals, 0, sizeof(iVals)); if (m_pTexture->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecIntItem* pItem = new vogleditor_stateTreeStateVecIntItem(#name, name, 0, m_pTexture->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
+#define GET_ENUM(name, num) memset(iVals, 0, sizeof(iVals)); if (m_pTexture->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecEnumItem* pItem = new vogleditor_stateTreeStateVecEnumItem(#name, name, 0, m_pTexture->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
+#define GET_FLOAT(name, num) memset(fVals, 0, sizeof(fVals)); if (m_pTexture->get_params().get<float>(name, 0, fVals, num)) { vogleditor_stateTreeStateVecFloatItem* pItem = new vogleditor_stateTreeStateVecFloatItem(#name, name, 0, m_pTexture->get_params(), fVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
                   GET_INT(GL_TEXTURE_BASE_LEVEL, 1);
                   int base_level = iVals[0];
                   GET_INT(GL_TEXTURE_MAX_LEVEL, 1);