In a shader i (theoretically) want to fetch a material-value from a texture. However some objects won´t have such a material, so that it´s value will always be 1 or 0.
Now, instead of writing another shader (and of course switching between lots of only slightly different shaders), i can also bind a “dummy”-texture, which is plain white or black.
Of course such a texture would only be 2x2, or so. So, how expensive is such texture-access ? Should i expect the same performance hit, as if i used a bigger texture, or should it be very fast ?
You know the answer Jan: benchmark it!
There’s no other way to know really. Unless your pixel shader limited and have many texture sampling instructions, I doubt it would make much difference to performance, but it’s impossible to know without testing. The shaders I’ve written are mostly math bound, not texture op bound, but this obviously varies depending on app.
Texture binding can be a slow-down factor if you use many textures (thousands). But if you consolidate your 2x2 textures into a larger one, like 128x128, you wouldn’t spend much time with the binding.