i965, anv, iris: Implement NV_compute_shader_derivatives
Overview:
In unextended OpenGL, the GLSL shading language supports derivatives in fragment shaders, which are computed on shader inputs or on other computed values using fragments' (x,y) coordinates as the domain. Derivatives are not supported in any other shader stage. However, compute shaders also arrange shader invocations in a three-dimensional array with (x,y,z) coordinates. This extension provides a mechanism where compute shaders can similarly evaluate derivatives using the x and y coordinates of the local invocation ID across a set of invocations with identical z coordinates.
The more important changes are in the two commits in intel/fs. The rest is either extension boilerplate or passing information around.
Tests:
- GL in Piglit piglit!31 (merged)
- Vulkan in Crucible crucible!35 (merged)
References:
- GLSL extension: https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GLSL_NV_compute_shader_derivatives.txt
- SPIR-V extension: http://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/NV/SPV_NV_compute_shader_derivatives.html
- GL extension: https://www.khronos.org/registry/OpenGL/extensions/NV/NV_compute_shader_derivatives.txt
- Vulkan extension: https://raw.githubusercontent.com/KhronosGroup/Vulkan-Docs/master/appendices/VK_NV_compute_shader_derivatives.txt