X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=header.comp;h=f4ebbed039cf35333b6f0b7a165169d9ac1e50a8;hp=266e24fc83b4519c3bd3a7247b711a23bb7b87c9;hb=39474abd238b7c3b27ed08cfbf695caa0cca91dd;hpb=3b9957afac0555a126d1941d7027fb52e29b309a diff --git a/header.comp b/header.comp index 266e24f..f4ebbed 100644 --- a/header.comp +++ b/header.comp @@ -1,23 +1,18 @@ #version 150 #extension GL_ARB_compute_shader : enable #extension GL_ARB_shader_image_load_store : enable +#extension GL_ARB_shader_image_size : enable -// FIXME this needs to be auto-output or something -uniform restrict writeonly image2D outbuf; +// The texture the compute shader is writing to. +uniform restrict writeonly image2D tex_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)