PDA

View Full Version : Per sample A-Buffer using OpenGL 4.0+ ??



scagja
12-14-2010, 01:32 AM
Hi,

I have implemented the a-buffer method described at http://blog.icare3d.org/2010/06/fast-and-accurate-single-pass-buffer.html

Now, i'm aiming to extend it to a per sample version using multisample images. My question is which are the definitions of imageLoad and imageStore functions using a multisample type of image.

I have followed the instructions from GL_EXT_shader_image_load_store extension page without luck.
Here is an example code of the per-sample initialization fragment shader:



#version 410 core
#extension GL_NV_gpu_shader5 : enable
#extension GL_EXT_shader_image_load_store : enable

precision highp float;

coherent uniform layout(size1x32) uimage2DMS image_count;
coherent uniform layout(size4x32) image2DMSArray image_color;

void main(void)
{
ivec2 coords = ivec2(gl_FragCoord.xy);

imageStore(image_count, coords, uvec4(0), gl_SampleID);
imageStore(image_color, ivec3(coords, 0), vec4(0.0f), gl_SampleID);

discard;
}


...which has the following syntax errors:
error C1115: unable to find compatible overloaded function "imageStore(struct uimage2DMS1x32, ivec2, uvec4, int)"
error C1115: unable to find compatible overloaded function "imageStore(struct image2DMSArray4x32, ivec3, vec4, int)"

scagja
12-20-2010, 02:15 AM
I solved it. The declaration of imageStore function for passing a multisample image is



void imageStore(gimage2DMS image, ivec2 coord, int sample, gvec4 data);