Jump to content
  • Advertisement
Sign in to follow this  
lomateron

HLSL load() of directx 10 in directx 9

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

what do you use to load one pixel value in directx 9, can that still be used in directx 10? if yes, is it faster than Load()?

Edited by lomateron

Share this post


Link to post
Share on other sites
Advertisement

In D3D9, you have to use the sample functions. And no, it is not faster than load; sample has to do floating-point multiply and cast to integer to resolve the memory address of the sampled texels, as well as (potentially) load much more texels than one (in case you have any filtering on). The upside of sampling is that simple filtering is "free" if all the involved texels are in local cache.

 

The situation is due to the fact that older hardware did not expose integer operations in shaders (because they likely didn't have programmable integer processing units).

Edited by Nik02

Share this post


Link to post
Share on other sites

Fun AMD hack: If you set filtering to point, but mipmapping to anisotropic without mipmaps in the texture, and use sample2DLod, the driver will recognize it and you should get faster sampling of single pixels. Same with DX10's SampleLevel.

But profile it first; just to be sure it's done right.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!