glsl/nir: add pixel_center_integer to shader info
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 16 Feb 2018 05:10:58 +0000 (16:10 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 18 Feb 2018 21:47:48 +0000 (08:47 +1100)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/glsl_to_nir.cpp
src/compiler/shader_info.h

index 1a579f41cd343e1bfd1b6a718e6d3eb31dd38311..7a9d15015e25f51f0ca4d823d507654bc0902f36 100644 (file)
@@ -406,6 +406,11 @@ nir_visitor::visit(ir_variable *ir)
    var->data.pixel_center_integer = ir->data.pixel_center_integer;
    var->data.location_frac = ir->data.location_frac;
 
+   if (var->data.pixel_center_integer) {
+      assert(shader->info.stage == MESA_SHADER_FRAGMENT);
+      shader->info.fs.pixel_center_integer = true;
+   }
+
    switch (ir->data.depth_layout) {
    case ir_depth_layout_none:
       var->data.depth_layout = nir_depth_layout_none;
index f6dedb8d624c03986597e6953f68f6173c06b458..e7fd7dbe62de2c63b0abc76d0d7373c744204fca 100644 (file)
@@ -159,6 +159,8 @@ typedef struct shader_info {
 
          bool post_depth_coverage;
 
+         bool pixel_center_integer;
+
          /** gl_FragDepth layout for ARB_conservative_depth. */
          enum gl_frag_depth_layout depth_layout;
       } fs;