Merge pull request #376 from hsdk/GLTransformFeedbackFixes

Fix for GLTransformFeedback crash in computeStencil
This commit is contained in:
Manuel Kraemer 2015-01-12 16:58:25 -08:00
commit 3ab9d9693e

View File

@ -31,7 +31,7 @@ uniform samplerBuffer vertexBuffer;
out float outVertexBuffer[LENGTH];
uniform isamplerBuffer sizes;
uniform usamplerBuffer sizes;
uniform isamplerBuffer offsets;
uniform isamplerBuffer indices;
uniform samplerBuffer weights;
@ -54,16 +54,16 @@ void clear(out Vertex v) {
}
void addWithWeight(inout Vertex v, Vertex src, float weight) {
for(int i = 0; i < LENGTH; i++) {
v.vertexData[i] += weight * src.vertexData[i];
for(int j = 0; j < LENGTH; j++) {
v.vertexData[j] += weight * src.vertexData[j];
}
}
Vertex readVertex(int index) {
Vertex v;
int vertexIndex = primvarOffset + index * STRIDE;
for(int i = 0; i < LENGTH; i++) {
v.vertexData[i] = texelFetch(vertexBuffer, vertexIndex+i).x;
for(int j = 0; j < LENGTH; j++) {
v.vertexData[j] = texelFetch(vertexBuffer, vertexIndex+j).x;
}
return v;
}
@ -93,8 +93,8 @@ void computeStencil() {
Vertex dst;
clear(dst);
int offset = texelFetch(offsets, current).x,
size = texelFetch(sizes, current).x;
int offset = texelFetch(offsets, current).x;
uint size = texelFetch(sizes, current).x;
for (int i=0; i<size; ++i) {
int index = texelFetch(indices, offset+i).x;