I am having some problems with TBOs. I am attempting to do character skinning on the GPU (Vista nVidia 9600GT ForceWare 175.19 Drivers 126.96.36.19919).
The code works, but it does it at a really slow pace. I used gDEBugger to help track the problem and using the nVidia GLExpert options it looks like all my TBO are in “SYSTEM_HEAP” memory.
The code is as follows (Which is paraphrased so there might be some typos):
I have 6 TBO allocated as follows:
glGenBuffers( 1, &vertexBO);
glBindBuffer( GL_TEXTURE_BUFFER_EXT, vertexBO);
glBufferData( GL_TEXTURE_BUFFER_EXT, vertexCount, NULL, GL_STATIC_DRAW);
glBufferSubData( GL_TEXTURE_BUFFER_EXT, offset, size, pointer);
I have 6 textures allocated as follows:
glGenTextures( 1, &textureBO);
Then when I want to do actual skinning I do:
and for each of the six TBOs:
glBindTexture( GL_TEXTURE_BUFFER_EXT, textureID);
glTexBufferEXT( GL_TEXTURE_BUFFER_EXT, format, vertexBO);
Where ‘format’ is one of GL_LUMINANCE_ALPHA32I_EXT, GL_LUMINANCE32I_EXT, GL_LUMINANCE32F_ARB, GL_RGBA32F_ARB
and finishing with a glBegin( GL_TRIANGLE_STRIP)/glEnd() to draw a quad into a frame buffer. One RGBA/XYZW pixel per vertex.
The shader used is like this:
[b]uniform samplerBuffer sampler_1;
uniform usamplerBuffer sampler_2;
uvec2 data2 = texelFetchBuffer( sampler_2, someUV).xa;
float data1 = texelFetchBuffer( sampler_1, someOtherUV).x;
Does anybody have any ideas why I am getting so bad performance or how I can fix it.