X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=header.comp;h=3c07007c5f3c8fe2b0524ac3049b379866b3fb06;hb=e683d4e49549b2d4c6906d2ebc4184904f4fe9f8;hp=276656896c51dfdab5245dde05f404f87cb9eaf7;hpb=b4ec29a251e118f463ce940ffaf0945188bf6894;p=movit diff --git a/header.comp b/header.comp index 2766568..3c07007 100644 --- a/header.comp +++ b/header.comp @@ -3,21 +3,15 @@ #extension GL_ARB_shader_image_load_store : enable // FIXME this needs to be auto-output or something -layout(rgba16f) uniform restrict writeonly image2D outbuf; +uniform restrict writeonly image2D outbuf; -vec4 tex2D(sampler2D s, vec2 coord) -{ - return texture(s, coord); -} +// Defined in footer.comp. +vec4 tex2D(sampler2D s, vec2 coord); +void cs_output(uvec2 coord, vec4 val); +void cs_output(ivec2 coord, vec4 val); -void cs_output(uvec2 coord, vec4 val) -{ - imageStore(outbuf, ivec2(coord), val); -} - -void cs_output(ivec2 coord, vec4 val) -{ - imageStore(outbuf, coord, val); -} +// Used if there are any steps used to postprocess compute shader output. +// Initialized due to https://bugs.freedesktop.org/show_bug.cgi?id=103895. +vec4 CS_OUTPUT_VAL = vec4(0.0); #define OUTPUT(tc, val) cs_output(tc, val)