Jump to content
  • Advertisement
Sign in to follow this  
yk_cadcg

Is there a way to use Integer vertex coordinates?

This topic is 3924 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

[dx10, hlsl] Hi, i'm doing gpgpu, and hope to process integer elements in vs (better also in ps). so I draw a pointlist. to minimize memory transfer, i wish to store these int in the point coordinates. Can i do so? seems shader only accepts floats between [0,1] for SV_Position. thanks!

Share this post


Link to post
Share on other sites
Advertisement
System interpreted and generated values are fixed as you've observed, only the inputs and outputs of the entire pipeline have this degree of flexibility.

What evidence do you have to suggest that you need this optimization? The inter-stage linkage is typically register based such that the real pain comes from register pressure rather than bandwidth...

hth
Jack

Share this post


Link to post
Share on other sites
Thanks a lot, I appreciate your kind help very much.
i have to do a
int hash(int value){return value^123; }
for every element of a large int array A.
i'm exploring how to use dx api to accelerate it.
my original plan is to
1, draw points with "value" as coordinates
2, use vertex shader to do the hash
3, pixel shader does nothing, draw to screen
but now that int can't be coordinates(SV_Position), i have to sample a int texture in vs. i'm afraid that's slow.
Thanks.

Quote:
Original post by jollyjeffers
System interpreted and generated values are fixed as you've observed, only the inputs and outputs of the entire pipeline have this degree of flexibility.

What evidence do you have to suggest that you need this optimization? The inter-stage linkage is typically register based such that the real pain comes from register pressure rather than bandwidth...

hth
Jack


Share this post


Link to post
Share on other sites
I would make your integer array a texture or buffer - you can create a 1D array using an integer format for 8192 elements, or upto 32768 if you use a 4xInt32 format with clever addressing. In fact, the 4xInt32 approach should be very efficient as you're effectively implementing a SIMD type architecture over scalar hardware...

Use the geometry and rasterization to just set up texture coordinates into that 1D array, reading with POINT filtering should stop any corruption and if you're careful with your TC's you can write to cells correctly as well. Basically keep all integer mathematics in the pixel shader.

hth
Jack

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!