From 023ea3772dfcd81e6a5822a1812ff991d68cccd8 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 23 Mar 2017 11:54:16 +0100 Subject: 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 --- src/compiler/nir/nir.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compiler/nir/nir.h') diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index d032787a2a0..f88707a31a0 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2518,7 +2518,7 @@ typedef struct nir_lower_wpos_ytransform_options { bool nir_lower_wpos_ytransform(nir_shader *shader, const nir_lower_wpos_ytransform_options *options); -bool nir_lower_wpos_center(nir_shader *shader); +bool nir_lower_wpos_center(nir_shader *shader, const bool for_sample_shading); typedef struct nir_lower_drawpixels_options { int texcoord_state_tokens[5]; -- cgit v1.2.3