From: Timothy Arceri Date: Fri, 16 Feb 2018 05:10:58 +0000 (+1100) Subject: glsl/nir: add pixel_center_integer to shader info X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=347038baa9e897aee32df9db99a099146f249f42;p=mesa.git glsl/nir: add pixel_center_integer to shader info Reviewed-by: Kenneth Graunke --- diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 1a579f41cd3..7a9d15015e2 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -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; diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index f6dedb8d624..e7fd7dbe62d 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -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;