[Mesa-dev] [PATCH] glsl: Use the without_array predicate

2015-02-19 Thread Timothy Arceri
---
 src/glsl/ir.h | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index a0f48b2..9c60b07 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -450,11 +450,8 @@ public:
 */
inline bool is_interface_instance() const
{
-  const glsl_type *const t = this->type;
-
-  return (t == this->interface_type)
- || (t->is_array() && t->fields.array == this->interface_type);
-}
+  return (this->type->without_array() == this->interface_type);
+   }
 
/**
 * Set this->interface_type on a newly created variable.
-- 
2.1.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: Use the without_array predicate

2015-02-19 Thread Matt Turner
On Thu, Feb 19, 2015 at 11:57 AM, Timothy Arceri  wrote:
> ---
>  src/glsl/ir.h | 7 ++-
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/src/glsl/ir.h b/src/glsl/ir.h
> index a0f48b2..9c60b07 100644
> --- a/src/glsl/ir.h
> +++ b/src/glsl/ir.h
> @@ -450,11 +450,8 @@ public:
>  */
> inline bool is_interface_instance() const
> {
> -  const glsl_type *const t = this->type;
> -
> -  return (t == this->interface_type)
> - || (t->is_array() && t->fields.array == this->interface_type);
> -}
> +  return (this->type->without_array() == this->interface_type);

Remove the superfluous parentheses, and

Reviewed-by: Matt Turner 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glsl: Use the without_array predicate in some more places

2014-08-19 Thread Timothy Arceri
Signed-off-by: Timothy Arceri 
---
 src/glsl/link_uniform_initializers.cpp | 3 +--
 src/mesa/program/ir_to_mesa.cpp| 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/glsl/link_uniform_initializers.cpp 
b/src/glsl/link_uniform_initializers.cpp
index c6fe6a9..c938845 100644
--- a/src/glsl/link_uniform_initializers.cpp
+++ b/src/glsl/link_uniform_initializers.cpp
@@ -254,8 +254,7 @@ link_set_uniform_initializers(struct gl_shader_program 
*prog)
  if (var->data.explicit_binding) {
 const glsl_type *const type = var->type;
 
-if (type->is_sampler()
-|| (type->is_array() && type->fields.array->is_sampler())) {
+if (type->without_array()->is_sampler()) {
linker::set_sampler_binding(prog, var->name, var->data.binding);
 } else if (var->is_in_uniform_block()) {
const glsl_type *const iface_type = var->get_interface_type();
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 011ffed..e5844c3 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2432,8 +2432,7 @@ add_uniform_to_shader::visit_field(const glsl_type *type, 
const char *name,
}
 
gl_register_file file;
-   if (type->is_sampler() ||
-   (type->is_array() && type->fields.array->is_sampler())) {
+   if (type->without_array()->is_sampler()) {
   file = PROGRAM_SAMPLER;
} else {
   file = PROGRAM_UNIFORM;
-- 
1.9.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: Use the without_array predicate in some more places

2014-08-19 Thread Matt Turner
Thanks.

Reviewed-by: Matt Turner 

and committed.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev