Texture feature request

I sometimes use texture memory to speedup image convolution operations. In most of the cases I use the “clamp” functionality to get free edge extraction. In some cases, I however want the pixels outside the image to be 0. For these cases I have to insert an if-statement that checks each read if it’s outside the image or not. A nice feature would be to be able to set the value that is returned outside of the image, such that the if-statement can be removed. The if-statement actually reduces the performance significantly, this problem can be removed if hardware support for setting the value outside the image is available.

I sometimes use texture memory to speedup image convolution operations. In most of the cases I use the “clamp” functionality to get free edge extraction. In some cases, I however want the pixels outside the image to be 0. For these cases I have to insert an if-statement that checks each read if it’s outside the image or not. A nice feature would be to be able to set the value that is returned outside of the image, such that the if-statement can be removed. The if-statement actually reduces the performance significantly, this problem can be removed if hardware support for setting the value outside the image is available.

You can achieve the same effect by adding a one pixel wide frame of 0s and setting the mode to clamp.

You can achieve the same effect by adding a one pixel wide frame of 0s and setting the mode to clamp.