Why sample speed is low if dimension is NTOP?

In my fragment shader ,I use sampler3D to sample 3D texture. I don’t know the reason which the speed will turn down if one of dimension of 3D Texture is not two of power!
who can give me a explain or a link to find reason!
thanks advanced!

It’s simply more difficult for the GPU to be efficient with NPOT, as it defeats texture-cache optimizations such as swizzling.

For 3D, it’s even more important, I’d guess.

What hardware? Current ATI hardware don’t support NPOT on 3D textures.

What hardware? Current ATI hardware don’t support NPOT on 3D textures.
Um, there’s other hardware out there than ATi hardware.

If you want to figure out what’s the hardware restriction behind this you should simply figure out how it’s done in software for example… if you have power of two sized textures you can use bit shifts and mask technics to get the final texel position in your texture mapping, if one of the size differs from a power of two, you’re forced to do one extra multiplication before you’re able to read your texel: i.e. y*resolution_x+x instead of (y<<shift_x)|x, where shift_x is the power of 2 of the x resolution of your texture. The second one is in general much faster.

I dont think it kills cache optimisations such as swizzzling in some way like it’s been said, but on the other side maybe the multiplication has to be took on an ALU stage and it delays the texture pipeline latency… or something like this.

The integer divide for NPOT REPEAT is much more costly than the address calculation multiply.

Originally posted by Korval:
[quote]What hardware? Current ATI hardware don’t support NPOT on 3D textures.
Um, there’s other hardware out there than ATi hardware.
[/QUOTE]Yeah. Hence the question “what hardware?”. I’m not sure I understand what your point is.

Thanks your replies.

My card is GF6800GT!

How much of a performance drop are you seeing?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.