Changeset 1688
- Timestamp:
- Aug 1, 2012, 1:50:59 PM (11 years ago)
- Location:
- trunk/src/gpu
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gpu/vertexbuffer.cpp
r1603 r1688 237 237 Abort(); 238 238 #elif !defined __CELLOS_LV2__ 239 /* FIXME: we need to unbind what we bound */ 240 //glDisableVertexAttribArray(m_attrib); 241 /* FIXME: temporary kludge */ 242 for (int i = 0; i < 12; i++) 243 glDisableVertexAttribArray(i); 239 for (int i = 0; i < m_count; i++) 240 { 241 if (m_streams[i].reg >= 0) 242 { 243 for (int j = i + 1; j < m_count; j++) 244 if (m_streams[j].reg == m_streams[i].reg) 245 m_streams[j].reg = -1; 246 247 glDisableVertexAttribArray(m_streams[i].reg); 248 } 249 } 244 250 glBindBuffer(GL_ARRAY_BUFFER, 0); 245 /* FIXME: only useful for VAOs */251 /* FIXME: only useful for VAOs? */ 246 252 //glBindBuffer(GL_ARRAY_BUFFER, 0); 247 /* Or: */248 //glDisableVertexAttribArray(m_attrib);249 253 #else 250 254 /* Or even: */ … … 347 351 if (m_streams[i].index == m_streams[attr_index].index) 348 352 { 353 /* Remember the register used for this stream */ 354 m_streams[i].reg = reg; 355 349 356 stride += m_streams[i].size; 350 357 if (i < attr_index) … … 523 530 m_streams[m_count].size = s.m_streams[i].size; 524 531 m_streams[m_count].index = index; 532 m_streams[m_count].reg = -1; 525 533 m_count++; 526 534 } -
trunk/src/gpu/vertexbuffer.h
r1468 r1688 124 124 }; 125 125 126 /* Specialise this template for "void" to act as a NOP */ 126 127 template<> 127 128 inline void VertexStreamBase::AddStream<void>(int n, VertexUsage usage) … … 199 200 void AddStream(VertexStreamBase const &); 200 201 201 struct { uint8_t stream_type, index, usage, size; } m_streams[12 + 1];202 struct { uint8_t stream_type, index, usage, size; int reg; } m_streams[12 + 1]; 202 203 int m_count; 203 204
Note: See TracChangeset
for help on using the changeset viewer.