Sign in to follow this  

dependant texture reads...

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

Quote:
Original post by Muncher
What is a dependant texture read (in a pixel shader) ?


In the old days, texture were fetched via a texture coordinates that was interpolated with the vertex attributes. But then that allows only a limited some of effects.

Then with pixel shaders came the ability for a texture coordinate to be computed inside the pixel shader.
The texture coordinates that are computed inside the pixel shader and are used to fetch a textures there, are called dependant texture read.

Older hardwares only supported only a limited number of dependant texture reads all other texture reads had to be from texture coordinates linearly interpolated directly from the vertex attributes. Modern hardware allow unlimited dependant texture reads (but not unlimited number of textures !)

LeGreg

Share this post


Link to post
Share on other sites

ok that makes sense, thanks (rating++)


Just off topic (and i apologise) On new hardware (gf6/7 etc) - the number of textures we can sample in a pixel shader is limited the the number of texture units right? So my geforce 7800 can access 4 textures per program
(num texture units is 4)...

But while looking up dependant texture reads, i came across an article that stated
"its possible to access up to 8 different textures (in a fragment program), but only a limited number of dependant texture fetches can be performed..."

Does this mean that we can access more textures in a shader if they are not read dependently?

Share this post


Link to post
Share on other sites
You can safely fetch from 8 textures on a 7800. The number of texture units is an internal implementation detail of the card, and only affects the performance of texture sampling.

Don't forget that on modern cards you can sample many times from the same texture during a pixel shader invocation, and this capability isn't limited by the number of texture pipelines.

Dependent reading is a separate capability.

Share this post


Link to post
Share on other sites
The number of texture units available depends on the card itself obviously, but is also sometimes different between fixed-function texture units, and what you can use in a shader. The number of units you can use in a shader is usually higher than what fixed function allows.

Share this post


Link to post
Share on other sites
Quote:
Original post by Muncher
"its possible to access up to 8 different textures (in a fragment program), but only a limited number of dependant texture fetches can be performed..."


This depends on your pixel shader version as well as the capabilities of your card.
Pixel shader version 1.x had very limited dependant texture read capabilities.
Pixel shader 2.0 can only make four dependant texture reads inside a pixel shader. The only reason is simply that ps2.0 = mirror of the radeon 9700 hardware.
Pixel shaders 2.x/3.0 and future 4.0 can do an unlimited number of dependant texture reads. Those are supported only by geforce 6/7, the newest x1800/x1900 and future d3d10 hardware.

Number of texture reads (and dependant texture reads) has nothing to do with the number of texture units (those are duplicated so that they can work in parallel and make an efficient use of available bandwidth), but has everything to do with the architecture of the pixel shader unit. Number of textures that you can read with a pixel shader stays the same for the high end part that has 16 times more texture units than the low end part.
How does that work if you have more texture reads than texture units ? it works the same as with ALU (math units), the workload is looped over the unit until it's done.

LeGreg

Share this post


Link to post
Share on other sites
Only a little correction.

The 2.x model say nothing about dependent reads. GPUS that support the 2.a pixel shader profile have unlimited dependent reads. 2.b only supports 4 like 2.0.

Share this post


Link to post
Share on other sites

This topic is 4103 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this