Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a sample using multisample images loads and stores.. #7

Open
oscarbg opened this issue Mar 12, 2013 · 0 comments
Open

Add a sample using multisample images loads and stores.. #7

oscarbg opened this issue Mar 12, 2013 · 0 comments

Comments

@oscarbg
Copy link

oscarbg commented Mar 12, 2013

This samples show three things:
*imageLoad even not allowed on multisampled images on AMD cards.. (even on latest HD7xxx series)
*Unique ability of NV GPUs to use even imageStore with image2DMS (this is unique in all APIs (as d3d provides RWTexture2D and Texture2DMS but not RWTexture2DMS (feature for DX 12? :-) )
*Inability in GLSL of getting # of samples of attached tex (though some of your samples also suffer from lack of this having hardcoded values of 4)
Shader:

version 400 compatibility

extension GL_ARB_shader_image_load_store : enable

extension GL_ARB_shader_image_size : enable

uniform layout(rgba8) image2DMS ColorImage;
in ivec2 gl_FragCoord;
void main(void)
{
ivec2 coords = ivec2(gl_FragCoord.xy);
vec4 color=vec4(0,0,0,0);
for(int i=0; i<4; i++)
{
color += imageLoad(ColorImage, coords, i);
}
ivec2 temp=imageSize(ColorImage);
imageStore(ColorImage, coords+ivec2(1,2), gl_SampleID+1,temp.xyxy+color);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant