Jump to content
  • Advertisement
Sign in to follow this  
yk_cadcg

how to store 32*2-bit int2 to textures?

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

att, although D3DFMT_G32R32F can store 2 values of 32 bits, they are of float format. how to write shader on handling a structure of struct int2{ int x; int y;}?? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
You can't directly. You can theoretically use D3DFMT_A16B16G16R16 to store 4 shorts and perform calculations that will end up treating them as two ints. Note that shaders use floating point and can't handle 32 bit integers anyway. It really begs the question of why you need such support. If you truly need it, you might prefer going the DX10 way.

Share this post


Link to post
Share on other sites
Thanks. I use int32 because I'm doing a GPGPU thing, and the value in other areas often has a 4-byte integer form..
My question is: does DX10 supports int32?
I installed DirectX2007.April on WindowsXP sp2, in sdk's "D3DFORMAT" page, I can't find "int32" alike. What do you mean by " going the DX10 way"? Thanks!

Quote:
Original post by ET3D
You can't directly. You can theoretically use D3DFMT_A16B16G16R16 to store 4 shorts and perform calculations that will end up treating them as two ints. Note that shaders use floating point and can't handle 32 bit integers anyway. It really begs the question of why you need such support. If you truly need it, you might prefer going the DX10 way.


Share this post


Link to post
Share on other sites
I meant using Direct3D 10 instead of D3D9. It includes support for integer math in shaders, and other things that help with GPGPU work. Note that it's still geared mainly towards floating point, so if you're looking mainly to working with integer math, the GPU might not be best for this. Note also that Direct3D 10 requires Vista.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!