Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

reading texture performance question

4: Adsense

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   

491
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.


#2 Nik02   Members   

4297
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   Members   

8002
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   Members   

13155
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.