#version 430 core
////////////////////////////////////////////////////////////////////////////////
// <copyright>
// Copyright (c) 2015 Hue AS. All rights reserved.
//
// All rights are reserved. Reproduction or transmission in whole or in part, in
// any form or by any means, electronic, mechanical or otherwise, is prohibited
// without the prior written permission of the copyright owner.
// </copyright>
////////////////////////////////////////////////////////////////////////////////

layout(r32ui, binding=0) uniform uimage2D counts;
layout(pixel_center_integer) in vec4 gl_FragCoord;
layout(early_fragment_tests) in;

void main()
{
    if (gl_FragCoord.z < 0.0) discard;
    imageAtomicAdd(counts, ivec2(gl_FragCoord.xy), 1);
}
