Homebrew How does the GPU know which vertex attribute is what?

  • Thread starter Thread starter cal64
  • Start date Start date
  • Views Views 1,345
  • Replies Replies 6

cal64

Well-Known Member
Newcomer
Joined
Oct 31, 2016
Messages
65
Reaction score
8
Trophies
0
Age
33
XP
466
Country
France
Is it setup in the vertex shader? If so, is there any documentation on that? Or is it something different?

Thanks for reading, any help is very appreciated!!
 
Ok figured id explain a bit:
When you declare a vertex attribute, you don't explicitly state what it is (pos, normal, texcoord), just what it's made of.
I can't seem to find how the gpu then figures out what each atttibute is for.

Any help?
 
When you call GPU_SetAttributeBuffers, you set up how many vectors you will send to the vertex shader, and for each vector, how many elements.

At the vertex shaders, you receive input from your vertex buffers, through the registers v0, v1, ..., after doing the necessary transformations to these vectors, you can then set the final values to the output registers. It is at the point you will decide whether the transformed v0 will be the tex coordinate, position on screen or the colour.
 
When you call GPU_SetAttributeBuffers, you set up how many vectors you will send to the vertex shader, and for each vector, how many elements.

At the vertex shaders, you receive input from your vertex buffers, through the registers v0, v1, ..., after doing the necessary transformations to these vectors, you can then set the final values to the output registers. It is at the point you will decide whether the transformed v0 will be the tex coordinate, position on screen or the colour.
Thank you soooooo much!!!
You can't even imagine how much you helped me there!
 
Thank you soooooo much!!!
You can't even imagine how much you helped me there!
I just want to mention that if you are doing stuff like this then make sure to test on real hardware - early and often. There are all sorts on sins that emulators will happily work with but will cause the real hardware to lockup immediately or not display correctly. Just my 2 cents.
 
I just want to mention that if you are doing stuff like this then make sure to test on real hardware - early and often. There are all sorts on sins that emulators will happily work with but will cause the real hardware to lockup immediately or not display correctly. Just my 2 cents.
Oh wow. Thanks a lot for mentionning that, I wouldn't have expected such a thing :).
You just saved from potentially a lot of frustration!
 

Site & Scene News

Popular threads in this forum