yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

janharaldfredriksen-armGL_KHR_compute_shader_derivatives bugfixes118ac898

main
644 B25 linesraw
1#version 450
2#extension GL_NV_compute_shader_derivatives : require
3
4layout (local_size_x = 2, local_size_y = 4) in;
5
6/*
7 * GLSL_NV_compute_shader_derivatives says about derivative_group_quadsNV
8 * and derivative_group_linearNV that:
9 *   If neither layout qualifier is specified, derivatives in compute shaders
10 *   return zero, which is consistent with the handling of built-in texture
11 *   functions like texture() in GLSL 4.50 compute shaders.
12 */
13
14layout(set = 0, binding = 1) buffer block {
15  float fDerivativeX;
16  float fDerivativeY;
17  
18  float fX;
19  float fY;
20};
21
22void main(){
23    fDerivativeX = dFdx(fX);
24    fDerivativeY = dFdy(fY);
25}