fix possible invalid vbo reads

- make sure there is an additional vertex for interleaving
This commit is contained in:
Hannes Janetzek 2013-02-24 11:25:28 +01:00
parent b328d769a5
commit ecedccb265
2 changed files with 9 additions and 2 deletions

View File

@ -157,6 +157,8 @@ public class Layers {
//sbuf.position(sbuf.position() + 6); //sbuf.position(sbuf.position() + 6);
addPoolItems(l, sbuf); addPoolItems(l, sbuf);
//l.offset -= 12; //l.offset -= 12;
sbuf.position(sbuf.position() + 6);
} }
} }

View File

@ -94,8 +94,13 @@ public final class LineTexLayer extends Layer {
// HACK add one vertex offset when compiling // HACK add one vertex offset when compiling
// buffer otherwise one cant use the full // buffer otherwise one cant use the full
// VertexItem // VertexItem (see Layers.compile)
//verticesCnt = 1; // add the two 'x' at front and end
//verticesCnt = 2;
// the additional end vertex to make sure
// not to read outside allocated memory
verticesCnt = 1;
} }
VertexPoolItem si = curItem; VertexPoolItem si = curItem;