From: Rich Geldreich Date: Tue, 25 Mar 2014 11:20:43 +0000 (-0700) Subject: - Fixing restore of indexed uniform buffer bindings X-Git-Url: https://git.cworth.org/git?p=vogl;a=commitdiff_plain;h=311d1014add8ac2b16e4a9b8687e1f69cae180cd - Fixing restore of indexed uniform buffer bindings - Fixing remapping of uniform locations when the compiler assigns different locations on restore vs. tracing - Fixing strange crash in editor --- diff --git a/src/voglcommon/vogl_general_context_state.cpp b/src/voglcommon/vogl_general_context_state.cpp index 94a7189..45c96b7 100644 --- a/src/voglcommon/vogl_general_context_state.cpp +++ b/src/voglcommon/vogl_general_context_state.cpp @@ -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(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) { diff --git a/src/voglcommon/vogl_gl_replayer.cpp b/src/voglcommon/vogl_gl_replayer.cpp index 454bd98..e5023c7 100644 --- a/src/voglcommon/vogl_gl_replayer.cpp +++ b/src/voglcommon/vogl_gl_replayer.cpp @@ -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) { diff --git a/src/voglcommon/vogl_program_state.cpp b/src/voglcommon/vogl_program_state.cpp index bfc8a99..5998a41 100644 --- a/src/voglcommon/vogl_program_state.cpp +++ b/src/voglcommon/vogl_program_state.cpp @@ -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) { diff --git a/src/vogleditor/vogleditor_statetreetextureitem.cpp b/src/vogleditor/vogleditor_statetreetextureitem.cpp index 25ffb6e..e86045a 100644 --- a/src/vogleditor/vogleditor_statetreetextureitem.cpp +++ b/src/vogleditor/vogleditor_statetreetextureitem.cpp @@ -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(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(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(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(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(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(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);