KhronosGroup / KhronosGroup/GLSL

[feature request] Add lod parameter to imageLoad / imageStore

Open
#306 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
458
Forks
114
Avg merge
4m
Merged PRs (30d)
1

Description

When an image is binded to a shader as a sampled image, you can access the mip levels of the image by specifying the desired mip level in the texture access call:
```glsl
uniform sampler2D sampledImage;
void main() {
ivec2 p = ...;
int lod = ...;
vec4 v = texelFetch(sampledImage, p, lod);
}
```
However, if the image is binded as a storage, you cannot access the different mip levels directly and have to resort to binding the mip levels individually in an array of images:
```glsl
uniform image2D storageImage[];
void main() {
ivec2 p = ...;
int lod = ...;
vec4 v = imageLoad(storageImage[lod], p);
}
```
This works, but it would be much nicer to just be able to specify the desired lod inside the imageLoad / imageStore call, like you can for sampled images: `imageLoad(storageImage, p, lod)`. Would it be possible to add this, or am I missing something ?

Contributor guide

Open the contributing guide

Research direction

Start from the issue's imageLoad and imageStore examples and review how storage-image access and mip levels are specified. Done means reaching agreement on whether a lod parameter should be added and documenting the resulting GLSL specification change.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.