<p>No. When you use image load/store, you don't get to play &quot;texture&quot; games like playing with the border color, doing filtering on values, etc. You are fetching a texel from a particular location.</p>
<p>If you want this, you will have to detect the out-of-bounds access and choose to substitute an alternate value. You can query the image's size, so it should be easy enough to detect.</p>

CC BY-SA 4.0
2021-02-05T14:43:00.280Z
2021-02-05T14:43:00.280Z
Nicol Bolas
<p>Is there a way to influence the behavior of <code>imageLoad()</code> for accessing an <code>image2D</code> or <code>uimage2D</code> with an out-of-bounds texel coordinate; for example repeat the last <em>good</em> texel instead of returning 0s?</p>

<opengl><glsl><vulkan><image-load-store>
imageLoad() behavior for non-existent texel
Vectorizer
# imageLoad() behavior for non-existent texel

(Asked by: username_0 on 2021-02-05)

Is there a way to influence the behavior of `imageLoad()` for accessing an `image2D` or `uimage2D` with an out-of-bounds texel coordinate; for example repeat the last *good* texel instead of returning 0s?

**Tags:** opengl, glsl, vulkan, image-load-store


---

## 1 answers

### Answer by username_1 on 2021-02-05. Score: 1 | Accepted answer

No. When you use image load/store, you don't get to play "texture" games like playing with the border color, doing filtering on values, etc. You are fetching a texel from a particular location.

If you want this, you will have to detect the out-of-bounds access and choose to substitute an alternate value. You can query the image's size, so it should be easy enough to detect.


---

