Skip to content

[feature request] Add lod parameter to imageLoad / imageStore #306

@rcmz

Description

@rcmz

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:

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:

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions