Jump to content
  • Advertisement
Sign in to follow this  
TosKeN

DX10 Load from Buffer object in vertex shader

This topic is 3758 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!