]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix incorrect vertex array indexing in InstanceArray
authorMikko Rasa <tdb@tdb.fi>
Tue, 1 Mar 2022 10:52:02 +0000 (12:52 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 1 Mar 2022 10:52:02 +0000 (12:52 +0200)
source/render/instancearray.cpp

index a838b948cf57600bf9c7a58d41439847a69126d0..a03fbf20dff9ca2766c15067087389e0d2902fd3 100644 (file)
@@ -85,7 +85,7 @@ void InstanceArray::update_instance_matrix(unsigned index)
 {
        const Matrix &m = *instances[index]->get_matrix();
 
-       float *d = reinterpret_cast<float *>(instance_data.modify(instances.size()-1)+matrix_offset);
+       float *d = reinterpret_cast<float *>(instance_data.modify(index)+matrix_offset);
        for(unsigned i=0; i<12; ++i)
                d[i] = m(i/4, i%4);
 }