Discussion:
[PATCH] nir: add missing local_group_size intrinsic
(too old to reply)
Rob Clark
2017-12-25 20:19:49 UTC
Permalink
Raw Message
For GL_ARB_compute_variable_group_size

Reported-by: Karol Herbst <***@gmail.com>
Signed-off-by: Rob Clark <***@gmail.com>
---
src/compiler/nir/nir.c | 4 ++++
src/compiler/nir/nir_intrinsics.h | 1 +
2 files changed, 5 insertions(+)

diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 688f2b1ae32..692d97bf9aa 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1969,6 +1969,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
return nir_intrinsic_load_subgroup_le_mask;
case SYSTEM_VALUE_SUBGROUP_LT_MASK:
return nir_intrinsic_load_subgroup_lt_mask;
+ case SYSTEM_VALUE_LOCAL_GROUP_SIZE:
+ return nir_intrinsic_load_local_group_size;
default:
unreachable("system value does not directly correspond to intrinsic");
}
@@ -2038,6 +2040,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
return SYSTEM_VALUE_SUBGROUP_LE_MASK;
case nir_intrinsic_load_subgroup_lt_mask:
return SYSTEM_VALUE_SUBGROUP_LT_MASK;
+ case nir_intrinsic_load_local_group_size:
+ return SYSTEM_VALUE_LOCAL_GROUP_SIZE;
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 ccf8e06336c..e776e05b4d5 100644
--- a/src/compiler/nir/nir_intrinsics.h
+++ b/src/compiler/nir/nir_intrinsics.h
@@ -363,6 +363,7 @@ SYSTEM_VALUE(subgroup_gt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_le_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_lt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_id, 1, 0, xx, xx, xx)
+SYSTEM_VALUE(local_group_size, 4, 0, xx, xx, xx)

/* Blend constant color values. Float values are clamped. */
SYSTEM_VALUE(blend_const_color_r_float, 1, 0, xx, xx, xx)
--
2.14.3
Kenneth Graunke
2017-12-26 03:22:20 UTC
Permalink
Raw Message
Post by Rob Clark
For GL_ARB_compute_variable_group_size
---
src/compiler/nir/nir.c | 4 ++++
src/compiler/nir/nir_intrinsics.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 688f2b1ae32..692d97bf9aa 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1969,6 +1969,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
return nir_intrinsic_load_subgroup_le_mask;
return nir_intrinsic_load_subgroup_lt_mask;
+ return nir_intrinsic_load_local_group_size;
unreachable("system value does not directly correspond to intrinsic");
}
@@ -2038,6 +2040,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
return SYSTEM_VALUE_SUBGROUP_LE_MASK;
return SYSTEM_VALUE_SUBGROUP_LT_MASK;
+ return SYSTEM_VALUE_LOCAL_GROUP_SIZE;
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 ccf8e06336c..e776e05b4d5 100644
--- a/src/compiler/nir/nir_intrinsics.h
+++ b/src/compiler/nir/nir_intrinsics.h
@@ -363,6 +363,7 @@ SYSTEM_VALUE(subgroup_gt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_le_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_lt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_id, 1, 0, xx, xx, xx)
+SYSTEM_VALUE(local_group_size, 4, 0, xx, xx, xx)
Should that be 3? gl_LocalGroupSizeARB is a uvec3 according to
builtin_variables.cpp.
Post by Rob Clark
/* Blend constant color values. Float values are clamped. */
SYSTEM_VALUE(blend_const_color_r_float, 1, 0, xx, xx, xx)
Rob Clark
2017-12-26 21:22:25 UTC
Permalink
Raw Message
Post by Kenneth Graunke
Post by Rob Clark
For GL_ARB_compute_variable_group_size
---
src/compiler/nir/nir.c | 4 ++++
src/compiler/nir/nir_intrinsics.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 688f2b1ae32..692d97bf9aa 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1969,6 +1969,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
return nir_intrinsic_load_subgroup_le_mask;
return nir_intrinsic_load_subgroup_lt_mask;
+ return nir_intrinsic_load_local_group_size;
unreachable("system value does not directly correspond to intrinsic");
}
@@ -2038,6 +2040,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
return SYSTEM_VALUE_SUBGROUP_LE_MASK;
return SYSTEM_VALUE_SUBGROUP_LT_MASK;
+ return SYSTEM_VALUE_LOCAL_GROUP_SIZE;
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 ccf8e06336c..e776e05b4d5 100644
--- a/src/compiler/nir/nir_intrinsics.h
+++ b/src/compiler/nir/nir_intrinsics.h
@@ -363,6 +363,7 @@ SYSTEM_VALUE(subgroup_gt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_le_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_lt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_id, 1, 0, xx, xx, xx)
+SYSTEM_VALUE(local_group_size, 4, 0, xx, xx, xx)
Should that be 3? gl_LocalGroupSizeARB is a uvec3 according to
builtin_variables.cpp.
yes, I thought I typed 3 (but to be fair was fairly distracted)

BR,
-R
Post by Kenneth Graunke
Post by Rob Clark
/* Blend constant color values. Float values are clamped. */
SYSTEM_VALUE(blend_const_color_r_float, 1, 0, xx, xx, xx)
Kenneth Graunke
2017-12-26 22:44:08 UTC
Permalink
Raw Message
Post by Rob Clark
Post by Kenneth Graunke
Post by Rob Clark
For GL_ARB_compute_variable_group_size
---
src/compiler/nir/nir.c | 4 ++++
src/compiler/nir/nir_intrinsics.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 688f2b1ae32..692d97bf9aa 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1969,6 +1969,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
return nir_intrinsic_load_subgroup_le_mask;
return nir_intrinsic_load_subgroup_lt_mask;
+ return nir_intrinsic_load_local_group_size;
unreachable("system value does not directly correspond to intrinsic");
}
@@ -2038,6 +2040,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
return SYSTEM_VALUE_SUBGROUP_LE_MASK;
return SYSTEM_VALUE_SUBGROUP_LT_MASK;
+ return SYSTEM_VALUE_LOCAL_GROUP_SIZE;
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 ccf8e06336c..e776e05b4d5 100644
--- a/src/compiler/nir/nir_intrinsics.h
+++ b/src/compiler/nir/nir_intrinsics.h
@@ -363,6 +363,7 @@ SYSTEM_VALUE(subgroup_gt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_le_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_lt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_id, 1, 0, xx, xx, xx)
+SYSTEM_VALUE(local_group_size, 4, 0, xx, xx, xx)
Should that be 3? gl_LocalGroupSizeARB is a uvec3 according to
builtin_variables.cpp.
yes, I thought I typed 3 (but to be fair was fairly distracted)
BR,
-R
With that change,
Reviewed-by: Kenneth Graunke <***@whitecape.org>
Jason Ekstrand
2017-12-27 01:39:08 UTC
Permalink
Raw Message
Post by Kenneth Graunke
Post by Rob Clark
Post by Kenneth Graunke
Post by Rob Clark
For GL_ARB_compute_variable_group_size
---
src/compiler/nir/nir.c | 4 ++++
src/compiler/nir/nir_intrinsics.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 688f2b1ae32..692d97bf9aa 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1969,6 +1969,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
return nir_intrinsic_load_subgroup_le_mask;
return nir_intrinsic_load_subgroup_lt_mask;
+ return nir_intrinsic_load_local_group_size;
unreachable("system value does not directly correspond to
intrinsic");
Post by Kenneth Graunke
Post by Rob Clark
}
@@ -2038,6 +2040,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op
intrin)
Post by Kenneth Graunke
Post by Rob Clark
return SYSTEM_VALUE_SUBGROUP_LE_MASK;
return SYSTEM_VALUE_SUBGROUP_LT_MASK;
+ return SYSTEM_VALUE_LOCAL_GROUP_SIZE;
unreachable("intrinsic doesn't produce a system value");
}
diff --git a/src/compiler/nir/nir_intrinsics.h
b/src/compiler/nir/nir_intrinsics.h
Post by Kenneth Graunke
Post by Rob Clark
index ccf8e06336c..e776e05b4d5 100644
--- a/src/compiler/nir/nir_intrinsics.h
+++ b/src/compiler/nir/nir_intrinsics.h
@@ -363,6 +363,7 @@ SYSTEM_VALUE(subgroup_gt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_le_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_lt_mask, 0, 0, xx, xx, xx)
SYSTEM_VALUE(subgroup_id, 1, 0, xx, xx, xx)
+SYSTEM_VALUE(local_group_size, 4, 0, xx, xx, xx)
Should that be 3? gl_LocalGroupSizeARB is a uvec3 according to
builtin_variables.cpp.
yes, I thought I typed 3 (but to be fair was fairly distracted)
BR,
-R
With that change,
Same
Post by Kenneth Graunke
----------
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Loading...