radeonsi/nir: fix gl_FragCoord for pixel_center_integer
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 16 Feb 2018 05:14:29 +0000 (16:14 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 18 Feb 2018 21:47:48 +0000 (08:47 +1100)
Fixes piglit test glsl-arb-fragment-coord-conventions

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/radeonsi/si_shader_nir.c

index 1ac6903bbc37df23192a3528b2dd9ff26b712cd6..4f44e968f83450a56e3c157a08351bf5459ca027 100644 (file)
@@ -281,6 +281,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: