[Mesa-dev] [PATCH v2 2/2] radeonsi/nir: fix gl_FragCoord for pixel_center_integer

Timothy Arceri tarceri at itsqueeze.com
Fri Feb 16 05:18:52 UTC 2018


Fixes piglit test glsl-arb-fragment-coord-conventions
---
 src/gallium/drivers/radeonsi/si_shader_nir.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 5ea1b4f033..ea9f2076da 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -290,6 +290,11 @@ void si_nir_scan_shader(const struct nir_shader *nir,
 			nir->info.fs.early_fragment_tests | nir->info.fs.post_depth_coverage;
 		info->properties[TGSI_PROPERTY_FS_POST_DEPTH_COVERAGE] = nir->info.fs.post_depth_coverage;
 
+		if (nir->info.fs.pixel_center_integer) {
+			info->properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER] =
+				TGSI_FS_COORD_PIXEL_CENTER_INTEGER;
+		}
+
 		if (nir->info.fs.depth_layout != FRAG_DEPTH_LAYOUT_NONE) {
 			switch (nir->info.fs.depth_layout) {
 			case FRAG_DEPTH_LAYOUT_ANY:
-- 
2.14.3



More information about the mesa-dev mailing list