I need at least the sampler variant in ir3..
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
}
}
-static unsigned
-glsl_type_get_sampler_count(const struct glsl_type *type)
-{
- if (glsl_type_is_array(type)) {
- return (glsl_get_aoa_size(type) *
- glsl_type_get_sampler_count(glsl_without_array(type)));
- }
-
- if (glsl_type_is_struct_or_ifc(type)) {
- unsigned count = 0;
- for (int i = 0; i < glsl_get_length(type); i++)
- count += glsl_type_get_sampler_count(glsl_get_struct_field(type, i));
- return count;
- }
-
- if (glsl_type_is_sampler(type))
- return 1;
-
- return 0;
-}
-
-static unsigned
-glsl_type_get_image_count(const struct glsl_type *type)
-{
- if (glsl_type_is_array(type)) {
- return (glsl_get_aoa_size(type) *
- glsl_type_get_image_count(glsl_without_array(type)));
- }
-
- if (glsl_type_is_struct_or_ifc(type)) {
- unsigned count = 0;
- for (int i = 0; i < glsl_get_length(type); i++)
- count += glsl_type_get_image_count(glsl_get_struct_field(type, i));
- return count;
- }
-
- if (glsl_type_is_image(type))
- return 1;
-
- return 0;
-}
-
void
nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
{
{
return type->cl_alignment();
}
+
+unsigned
+glsl_type_get_sampler_count(const struct glsl_type *type)
+{
+ if (glsl_type_is_array(type)) {
+ return (glsl_get_aoa_size(type) *
+ glsl_type_get_sampler_count(glsl_without_array(type)));
+ }
+
+ if (glsl_type_is_struct_or_ifc(type)) {
+ unsigned count = 0;
+ for (int i = 0; i < glsl_get_length(type); i++)
+ count += glsl_type_get_sampler_count(glsl_get_struct_field(type, i));
+ return count;
+ }
+
+ if (glsl_type_is_sampler(type))
+ return 1;
+
+ return 0;
+}
+
+unsigned
+glsl_type_get_image_count(const struct glsl_type *type)
+{
+ if (glsl_type_is_array(type)) {
+ return (glsl_get_aoa_size(type) *
+ glsl_type_get_image_count(glsl_without_array(type)));
+ }
+
+ if (glsl_type_is_struct_or_ifc(type)) {
+ unsigned count = 0;
+ for (int i = 0; i < glsl_get_length(type); i++)
+ count += glsl_type_get_image_count(glsl_get_struct_field(type, i));
+ return count;
+ }
+
+ if (glsl_type_is_image(type))
+ return 1;
+
+ return 0;
+}
const struct glsl_type *glsl_atomic_uint_type(void);
+unsigned glsl_type_get_sampler_count(const struct glsl_type *type);
+unsigned glsl_type_get_image_count(const struct glsl_type *type);
+
#ifdef __cplusplus
}
#endif