summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-03-21 15:22:10 -0700
committerJason Ekstrand <[email protected]>2017-05-03 11:25:46 -0700
commitbb41d9a1d30c243b8690165cd465c53517c6a35d (patch)
tree0eb82dba200451d632bdd273b76f97b115c5f8d4 /src/compiler/nir
parentfcf941068e67ca0483dc453dd27992e2cd27ea21 (diff)
compiler: Add a system value and varying for ViewIndex
Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir.c4
-rw-r--r--src/compiler/nir/nir_intrinsics.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 0abf9b6212e..8f7ed8a50f6 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1905,6 +1905,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
return nir_intrinsic_load_patch_vertices_in;
case SYSTEM_VALUE_HELPER_INVOCATION:
return nir_intrinsic_load_helper_invocation;
+ case SYSTEM_VALUE_VIEW_INDEX:
+ return nir_intrinsic_load_view_index;
default:
unreachable("system value does not directly correspond to intrinsic");
}
@@ -1956,6 +1958,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
return SYSTEM_VALUE_VERTICES_IN;
case nir_intrinsic_load_helper_invocation:
return SYSTEM_VALUE_HELPER_INVOCATION;
+ case nir_intrinsic_load_view_index:
+ return SYSTEM_VALUE_VIEW_INDEX;
default:
unreachable("intrinsic doesn't produce a system value");
}
diff --git a/src/compiler/nir/nir_intrinsics.h b/src/compiler/nir/nir_intrinsics.h
index 3a519a73ddd..21e7d904b78 100644
--- a/src/compiler/nir/nir_intrinsics.h
+++ b/src/compiler/nir/nir_intrinsics.h
@@ -329,6 +329,7 @@ SYSTEM_VALUE(helper_invocation, 1, 0, xx, xx, xx)
SYSTEM_VALUE(channel_num, 1, 0, xx, xx, xx)
SYSTEM_VALUE(alpha_ref_float, 1, 0, xx, xx, xx)
SYSTEM_VALUE(layer_id, 1, 0, xx, xx, xx)
+SYSTEM_VALUE(view_index, 1, 0, xx, xx, xx)
/* Blend constant color values. Float values are clamped. */
SYSTEM_VALUE(blend_const_color_r_float, 1, 0, xx, xx, xx)