Sign in to follow this  
TosKeN

DX10 Load from Buffer object in vertex shader

Recommended Posts

Hi all, i have a problem with loading data from a buffer object in a vertex shader. I created a Buffer object (ID3D10Buffer) and filled it with initial data. It contains 4 float variables for every vertex of my model ( size of buffer = numVerts * sizeof( float ) * 4 ). Now when i pass my model through the shader, i bind the additional buffer as a shader resource. In the model vertex shader i will fetch the float4 value for every vertex in the buffer. Buffer <float4> AOResultBuffer; ... ... // Fetch Vertex AOTerm from buffer. float4 bufferValue = AOResultBuffer.Load( int2( vVertexID, 0 ) ); My problem is, that i can only fetch the data for the first 16 vertices. For vertex ID's > 15 the buffer returns just 0. Is there a limitation for buffer load operations in vertex shader? Or what might be the problem? Actually i want the buffer to store an an ambient occlusion term for every vertex of the mesh. This term is computed by the GPU in a pre render pass and streamed out to this buffer. But for debuging the problem i don't use stream out. I just filled the buffer with 1.0 values and bind it as a shader resource. But for all load operation with location > 15 it rreturns 0. Thank You TosKeN

Share this post


Link to post
Share on other sites
Nobody who can help me?
I have read something that sounds like that it is only possible to do 16 load instructions per vertex stream.
Can that be true?

Share this post


Link to post
Share on other sites
If you don’t mind can you post your buffer and shader resource creation code?

Beside of these it may be a better solution to bind your streamed out buffer as additional input stream on the vertex shader instead of using it as shader resource.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this