aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-07-31 21:52:48 -0400
committerMarek Olšák <[email protected]>2019-08-12 14:52:17 -0400
commit1b881852bcc61f20ca46a27e29f4503b93f443be (patch)
tree148835f4b8405984053da192cc954a254369c222 /src/compiler
parentf0ccc5457aa7302960f1c43e2e8243edab61991d (diff)
compiler: add SYSTEM_VALUE_USER_DATA_AMD
for internal radeonsi shaders
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir.c4
-rw-r--r--src/compiler/nir/nir_intrinsics.py3
-rw-r--r--src/compiler/shader_enums.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 822c6ab5d27..1e6f15517f5 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -2022,6 +2022,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
return nir_intrinsic_load_global_invocation_index;
case SYSTEM_VALUE_WORK_DIM:
return nir_intrinsic_load_work_dim;
+ case SYSTEM_VALUE_USER_DATA_AMD:
+ return nir_intrinsic_load_user_data_amd;
default:
unreachable("system value does not directly correspond to intrinsic");
}
@@ -2109,6 +2111,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
return SYSTEM_VALUE_LOCAL_GROUP_SIZE;
case nir_intrinsic_load_global_invocation_id:
return SYSTEM_VALUE_GLOBAL_INVOCATION_ID;
+ case nir_intrinsic_load_user_data_amd:
+ return SYSTEM_VALUE_USER_DATA_AMD;
default:
unreachable("intrinsic doesn't produce a system value");
}
diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index cbbf8fba89e..f4ca623bb3d 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -614,6 +614,9 @@ system_value("blend_const_color_aaaa8888_unorm", 1)
system_value("color0", 4)
system_value("color1", 4)
+# System value for internal compute shaders in radeonsi.
+system_value("user_data_amd", 4)
+
# Barycentric coordinate intrinsics.
#
# These set up the barycentric coordinates for a particular interpolation.
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index d9eb290abf4..20e62da5b11 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -609,6 +609,7 @@ typedef enum
SYSTEM_VALUE_LOCAL_GROUP_SIZE,
SYSTEM_VALUE_GLOBAL_GROUP_SIZE,
SYSTEM_VALUE_WORK_DIM,
+ SYSTEM_VALUE_USER_DATA_AMD,
/*@}*/
/** Required for VK_KHR_device_group */