nir: Add intrinsics for object to/from world RT sysvals

These are a bit more tricky than most because they're matrix system
values.  We make the intentional choice here to not bother with allowing
indirect addressing of columns for these.  Since they're system values,
they may be magically constructed somehow or come from weird hardware so
it's easier on back-ends to just handle any indirects with bcsel.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6479>
This commit is contained in:
Jason Ekstrand
2020-06-18 12:50:21 -05:00
committed by Marge Bot
parent 07635a3284
commit aa4ea9c7ea
5 changed files with 45 additions and 4 deletions

View File

@@ -101,6 +101,8 @@ DESC_SET = "NIR_INTRINSIC_DESC_SET"
BINDING = "NIR_INTRINSIC_BINDING"
# Component offset
COMPONENT = "NIR_INTRINSIC_COMPONENT"
# Column index for matrix system values
COLUMN = "NIR_INTRINSIC_COLUMN"
# Interpolation mode (only meaningful for FS inputs)
INTERP_MODE = "NIR_INTRINSIC_INTERP_MODE"
# A binary nir_op to use when performing a reduction or scan operation
@@ -667,6 +669,8 @@ system_value("ray_object_origin", 3)
system_value("ray_object_direction", 3)
system_value("ray_t_min", 1)
system_value("ray_t_max", 1)
system_value("ray_object_to_world", 3, indices=[COLUMN])
system_value("ray_world_to_object", 3, indices=[COLUMN])
system_value("ray_hit_kind", 1)
system_value("ray_flags", 1)
system_value("ray_geometry_index", 1)