From cad4908fa00a5849e3d3f5077ed53798db2828c5 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Fri, 25 Feb 2022 12:44:36 +0530 Subject: [PATCH] nir: add load_point_coord_maybe_flipped intrinsics for point smoothing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gl_PointCoord can be flipped upside down via a state. To avoid this adding new load_point_coord_maybe_flipped intrinsics. Reviewed-by: Marek Olšák Part-of: --- src/compiler/nir/nir_intrinsics.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index ed39fb4988e..3a8c6499851 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -1520,3 +1520,10 @@ system_value("leaf_procedural_intel", 1, bit_sizes=[1]) # 3: Intersection system_value("btd_shader_type_intel", 1) system_value("ray_query_global_intel", 1, bit_sizes=[64]) + +# In order to deal with flipped render targets, gl_PointCoord may be flipped +# in the shader requiring a shader key or extra instructions or it may be +# flipped in hardware based on a state bit. This version of gl_PointCoord +# is defined to be whatever thing the hardware can easily give you, so long as +# it's in normalized coordinates in the range [0, 1] across the point. +intrinsic("load_point_coord_maybe_flipped", dest_comp=2, bit_sizes=[32])