nir/lower_wpos_center: support adding sample position to fragment coordinate
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 23 Mar 2017 10:54:16 +0000 (11:54 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Fri, 24 Mar 2017 07:11:53 +0000 (08:11 +0100)
commit023ea3772dfcd81e6a5822a1812ff991d68cccd8
tree84eed0e61e23318b9426860ee807190948124626
parent4da1832c00ab93cbf90b14501840dd698565a869
nir/lower_wpos_center: support adding sample position to fragment coordinate

According to section 14.6 of the Vulkan specification:

   "When sample shading is enabled, the x and y components of FragCoord
    reflect the location of the sample corresponding to the shader
    invocation."

So add a boolean parameter to the lowering pass to select this behavior
when we need it.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_wpos_center.c
src/intel/vulkan/anv_pipeline.c