Jump to content
  • Advertisement
Sign in to follow this  
IrYoKu1

Load vs SampleLevel [DX10 HLSL]

This topic is 2955 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 been wondering what is the most efficient/correct way of sampling pixels in a screen-space postfx shader, that doesn't require performing any kind of filtering (in DX10):

- Using Load, which requires a multiply for converting coordinates from 0..1 to 0..width
- Or using SampleLevel, and specify the first level of the chain (0). I'm thinking that maybe this incurs in a performance penalty, even if you're using a texture without mipmaps as input?

Any opinions about this?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
There is really no good way to answer that question in all contexts. In some of my D3D11 work, I found some situations where Load was faster than sampling, and in other cases it was reversed. The memory subsystem is so much more complex now, and it is hardware/driver specific, making it very hard to accurately predict what is going on.

My advice would be to write a small function that uses one or the other with #defines, and then profile it for each case you are interested in using it. Then you'll find out how good or bad one or the other is for your particular situation.

Share this post


Link to post
Share on other sites
Quote:
Original post by IrYoKu1
So, it depends on the hardware. Thanks!


It could even depend on the driver version.

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!