workGroupsRender
const vec2 workGroupsRender = vec2(<x_mult>, <y_mult>);
Location: *.csh
Defines a variable number of compute shader work groups to be dispatched based on a multiple of screen resolution. If neither this directive nor workGroups
is defined, work groups will be dispatched as if workGroupsRender == vec2(1.0, 1.0)
, which means that the smallest number of work groups will be dispatched to completely cover the screen with one shader invocation per pixel when arranged in a grid. If the screen resolution isn’t a multiple of vec2(gl_WorkGroupSize.xy) / workGroupsRender
, the number of invocations dispatched will be greater than the amount of pixels on the screen.
gl_NumWorkGroups == uvec3(ceil(vec2(viewWidth, viewHeight) * workGroupsRender / vec2(gl_WorkGroupSize.xy)), 1u)
For more info, see the compute shader section.