| #version 450 |
| #extension GL_NV_compute_shader_derivatives : require |
| |
| layout (local_size_x = 2, local_size_y = 4) in; |
| |
| /* |
| * GLSL_NV_compute_shader_derivatives says about derivative_group_quadsNV |
| * and derivative_group_linearNV that: |
| * If neither layout qualifier is specified, derivatives in compute shaders |
| * return zero, which is consistent with the handling of built-in texture |
| * functions like texture() in GLSL 4.50 compute shaders. |
| */ |
| |
| layout(set = 0, binding = 1) buffer block { |
| float fDerivativeX; |
| float fDerivativeY; |
| |
| float fX; |
| float fY; |
| }; |
| |
| void main(){ |
| fDerivativeX = dFdx(fX); |
| fDerivativeY = dFdy(fY); |
| } |