Jump to content

  • Log In with Google      Sign In   
  • Create Account


reading texture performance question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 lomateron   Members   -  Reputation: 339

Like
0Likes
Like

Posted 04 March 2013 - 10:11 PM

In the pixel shader i can do one of this two configuration

 

--reading from a R32G32B32A32 texture one time using Load() one time 

 

--reading from R32 texture four times using Load() four times

 

 

The first must be faster, lets say the pixel shader runs around 1,000,000 times is there a big difference between the two?


Edited by lomateron, 04 March 2013 - 10:11 PM.


Sponsor:

#2 Nik02   Crossbones+   -  Reputation: 2787

Like
0Likes
Like

Posted 05 March 2013 - 01:28 AM

The key is, what else does the pixel shader do?

 

And no, it is not obvious or given that the first one is faster.


Niko Suni


#3 phil_t   Crossbones+   -  Reputation: 3305

Like
0Likes
Like

Posted 05 March 2013 - 09:22 AM

I've seen cases where either one or the other is faster. Profile it in your particular scenario and see.

#4 mhagain   Crossbones+   -  Reputation: 7865

Like
0Likes
Like

Posted 05 March 2013 - 12:48 PM

Sometimes if you can interleave the 4 Loads with some ALU ops you'll get instructions for free.  Sometimes the 4 32-bit textures will fit in GPU caches more easily.  I'd suggest that rather than asserting that one way "must be faster" you instead write both codepaths and profile them against each other.  There is no answer to this because everybody's shader code is going to be different, so make a decision based on actual facts that are relevant to your use case and your code instead of suppositions.


Edited by mhagain, 05 March 2013 - 12:49 PM.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS