Limit on Active Textures?


Is there a limit on the active number of bound textures in a program?

My program binds 20 texture references at start of day… Different kernels use different texture references. One uses 16 , other uses 4 and so on…

Is this really OK? I am finding discrepancies in results as I am moving from 1D textures to 3D textures… Sure, it could be a software bug… But I am just curious if therez some kind of limitations while using textures, 3D textures etc…

Many thanks,

Best Regards,

Merry Christmas and Happy new year guys!
Appreciate any update to my question above… Thanks!

I’m not sure how relevant this may be, but for shader model 4.0 maximum number of texture samplers for vertex shaders is 128 (High-Level Shader Language - Wikipedia). For SM3.0 (Dx9.0c) it’s 16. It’s the only thing I found.

You probably are not hitting 128 samplers with 20 tex references so I suspect either a programming mistake on your part or a compiler error of some sort. Or perhaps you’re running a Dx9 driver which thinks your card has only 16 texture samplers? This doesn’t make much sense, just guessing.

Big_Mac is right, it’s 128. Sarnath, check out section 5.1.8 of the PTX ISA 1.4 Guide…I was just reading through it and remembered this post!

Thanks a lot to both of you! So, I guess its a programming mistake… Will have to figure it out…

Many Thanks and Happy new year!

Well, I figured the programming mistake:

[url=“”]The Official NVIDIA Forums | NVIDIA

xyz@CPU needs to be accessed as Z,Y,X via textures… This is something that is not straightforward in the documentation…

Thanks to both of you for your answers…