Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualChris_F

Posted 19 March 2014 - 12:13 PM

A texture array is a native resource type designed to let you access pixels in a big 3d volume of mip-mapped 2d slices.

 

An array of samplers is syntactic sugar over declaring a large number of individual samplers.

It's the same as having sampler0, sampler1, sampler2, etc... If you're using them in a loop that the compiler can unroll, then they're fine. If you're randomly indexing into the array, then I'd expect waterfalling to occur (i.e. if(i==0) use sampler0 elif(i==1) use sampler1, etc...)

 

I'm sure on old hardware that is the case. Old hardware doesn't even support bindless textures, so that is not really an issue anyway.

 

A quick experiment that renders 1024 random sprites per frame from an array of 32 images shows a performance difference of about 0.05ms when comparing a TEXTURE_2D_ARRAY to an array of bindless handles stored in a SSBO.

 

Edit: I just changed the SSBO to a UBO and now there is no performance difference at all.


#1Chris_F

Posted 19 March 2014 - 12:08 PM

A texture array is a native resource type designed to let you access pixels in a big 3d volume of mip-mapped 2d slices.

 

An array of samplers is syntactic sugar over declaring a large number of individual samplers.

It's the same as having sampler0, sampler1, sampler2, etc... If you're using them in a loop that the compiler can unroll, then they're fine. If you're randomly indexing into the array, then I'd expect waterfalling to occur (i.e. if(i==0) use sampler0 elif(i==1) use sampler1, etc...)

 

I'm sure on old hardware that is the case. Old hardware doesn't even support bindless textures, so that is not really an issue anyway.

 

A quick experiment that renders 1024 random sprites per frame from an array of 32 images shows a performance difference of about 0.05ms when comparing a TEXTURE_2D_ARRAY to an array of bindless handles stored in a SSBO.


PARTNERS