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
11 files
+ 302
70
Compare changes
  • Side-by-side
  • Inline
Files
11
#version 440
#extension GL_GOOGLE_include_directive : enable
#include "motionBlurConfig.inc"
#include "motionBlurWorkTile.inc"
layout(set=0, binding=0) uniform texture2D inColor;
layout(set=0, binding=1) uniform texture2D inDepth;
@@ -9,7 +11,11 @@ layout(set=0, binding=3) uniform texture2D inMotionNeighbou
layout(set=0, binding=4) uniform sampler nearestSampler;
layout(set=0, binding=5, r11f_g11f_b10f) uniform image2D outImage;
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
layout(set=0, binding=6) buffer copyPathTileBuffer {
WorkTiles workTiles;
};
layout(local_size_x = motionTileSize, local_size_y = motionTileSize, local_size_z = 1) in;
layout( push_constant ) uniform constants{
// computed from delta time and shutter speed
@@ -127,11 +133,14 @@ float dither(ivec2 coord){
void main(){
if(any(greaterThanEqual(gl_GlobalInvocationID.xy, imageSize(outImage))))
uint tileIndex = gl_WorkGroupID.x;
ivec2 tileCoordinates = workTiles.tileXY[tileIndex];
ivec2 coord = ivec2(tileCoordinates * motionTileSize + gl_LocalInvocationID.xy);
if(any(greaterThanEqual(coord, imageSize(outImage))))
return;
ivec2 textureRes = textureSize(sampler2D(inColor, nearestSampler), 0);
ivec2 coord = ivec2(gl_GlobalInvocationID.xy);
vec2 uv = vec2(coord + 0.5) / textureRes; // + 0.5 to shift uv into pixel center
// the motion tile lookup is jittered, so the hard edges in the blur are replaced by noise
Loading