Skip to content
Snippets Groups Projects

Resolve "Indirect Dispatch"

Merged Ghost User requested to merge 106-indirect-dispatch into develop
Compare and Show latest version
19 files
+ 592
60
Compare changes
  • Side-by-side
  • Inline
Files
19
@@ -9,14 +9,18 @@ layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
void main(){
if(any(greaterThanEqual(gl_GlobalInvocationID.xy, imageSize(outImage))))
ivec2 outImageRes = imageSize(outImage);
ivec2 coord = ivec2(gl_GlobalInvocationID.xy);
if(any(greaterThanEqual(coord, outImageRes)))
return;
ivec2 textureRes = textureSize(sampler2D(inTexture, textureSampler), 0);
ivec2 coord = ivec2(gl_GlobalInvocationID.xy);
vec2 uv = vec2(coord) / textureRes;
vec2 uv = vec2(coord) / outImageRes;
vec3 linearColor = texture(sampler2D(inTexture, textureSampler), uv).rgb;
// in case of motion vector visualisation negative values are possible
linearColor = abs(linearColor);
vec3 gammaCorrected = pow(linearColor, vec3(1 / 2.2));
imageStore(outImage, coord, vec4(gammaCorrected, 0.f));
Loading