Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 1 of 1

Thread: 3D Images

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2013
    Posts
    16

    3D Images

    I'm back with another basic question.

    I'm trying to use 3D images in my compute shader to store information later used by my fragment shader. This worked fine while it was a 2D image but now it is failing to compile.

    Before I was declaring my images as "uniform image2D image;". Which worked fine. Now when I'm declaring it as "uniform image3D image;" instead I'm getting errors on my imageStore() call as follows:
    Code glsl:
    O(56) : error C1115: unable to find compatible overloaded function "imageStore(struct image3D, vec3, vec4)"

    From what I've managed to gather this is because the compiler is assuming that image3D is a struct and not the built in type provided by GLSL. I've found some references saying that you need to specify the layout for image3D for it to be valid along the lines of "layout(rgba8) uniform image3D image;" however this only changes the error message to say ".... struct unimage3D4x8 ....". I saw mentions that specifying the layout was only needed if the image was not write only. And in this shader I am only writing to the images (of which there are 6).

    Any ideas?

    (Edit: I'm using #version 430 in case that matters.)

    (Edit 2: Turns out this was simply because I yet again forgot that images wants indexes in the range of [0, width) and so on not [0,1). In other words the indexes should be a ivec3 not a vec3.)
    Last edited by Mustard; 04-04-2013 at 04:53 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •