Re: [Mesa-dev] [PATCH] glsl: Rename linker's is_varying_var

2014-05-12 Thread Ian Romanick
Reviewed-by: Ian Romanick ian.d.roman...@intel.com

On 05/08/2014 04:28 PM, Chris Forbes wrote:
 Both the ast-IR and linker have functions with this name, but different
 behavior.
 
 Rename the linker's version to var_counts_against_varying_limit to be
 closer to what it is actually used for.
 
 Suggested by Ian a while back.
 
 Signed-off-by: Chris Forbes chr...@ijw.co.nz
 ---
 
 Note that there's actually a bug lurking in here -- 
 check_against_output_limit won't actually count anything, since it requires 
 var-data.mode == ir_var_shader_out and stage != MESA_SHADER_FRAGMENT.
 
  src/glsl/link_varyings.cpp | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
 index ac38a2f..71998df 100644
 --- a/src/glsl/link_varyings.cpp
 +++ b/src/glsl/link_varyings.cpp
 @@ -992,7 +992,7 @@ varying_matches::match_comparator(const void *x_generic, 
 const void *y_generic)
   * varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord.
   */
  static bool
 -is_varying_var(gl_shader_stage stage, const ir_variable *var)
 +var_counts_against_varying_limit(gl_shader_stage stage, const ir_variable 
 *var)
  {
 /* Only fragment shaders will take a varying variable as an input */
 if (stage == MESA_SHADER_FRAGMENT 
 @@ -1462,7 +1462,7 @@ check_against_output_limit(struct gl_context *ctx,
ir_variable *const var = ((ir_instruction *) node)-as_variable();
  
if (var  var-data.mode == ir_var_shader_out 
 -  is_varying_var(producer-Stage, var)) {
 +  var_counts_against_varying_limit(producer-Stage, var)) {
   output_vectors += var-type-count_attribute_slots();
}
 }
 @@ -1501,7 +1501,7 @@ check_against_input_limit(struct gl_context *ctx,
ir_variable *const var = ((ir_instruction *) node)-as_variable();
  
if (var  var-data.mode == ir_var_shader_in 
 -  is_varying_var(consumer-Stage, var)) {
 +  var_counts_against_varying_limit(consumer-Stage, var)) {
   input_vectors += var-type-count_attribute_slots();
}
 }
 

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


Re: [Mesa-dev] [PATCH] glsl: Rename linker's is_varying_var

2014-05-09 Thread Anuj Phogat
On Thu, May 8, 2014 at 4:28 PM, Chris Forbes chr...@ijw.co.nz wrote:

 Both the ast-IR and linker have functions with this name, but different
 behavior.

 Rename the linker's version to var_counts_against_varying_limit to be
 closer to what it is actually used for.

 Suggested by Ian a while back.

 Signed-off-by: Chris Forbes chr...@ijw.co.nz
 ---

 Note that there's actually a bug lurking in here -- 
 check_against_output_limit won't actually count anything, since it requires 
 var-data.mode == ir_var_shader_out and stage != MESA_SHADER_FRAGMENT.

  src/glsl/link_varyings.cpp | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

 diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
 index ac38a2f..71998df 100644
 --- a/src/glsl/link_varyings.cpp
 +++ b/src/glsl/link_varyings.cpp
 @@ -992,7 +992,7 @@ varying_matches::match_comparator(const void *x_generic, 
 const void *y_generic)
   * varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord.
   */
  static bool
 -is_varying_var(gl_shader_stage stage, const ir_variable *var)
 +var_counts_against_varying_limit(gl_shader_stage stage, const ir_variable 
 *var)
  {
 /* Only fragment shaders will take a varying variable as an input */
 if (stage == MESA_SHADER_FRAGMENT 
 @@ -1462,7 +1462,7 @@ check_against_output_limit(struct gl_context *ctx,
ir_variable *const var = ((ir_instruction *) node)-as_variable();

if (var  var-data.mode == ir_var_shader_out 
 -  is_varying_var(producer-Stage, var)) {
 +  var_counts_against_varying_limit(producer-Stage, var)) {
   output_vectors += var-type-count_attribute_slots();
}
 }
 @@ -1501,7 +1501,7 @@ check_against_input_limit(struct gl_context *ctx,
ir_variable *const var = ((ir_instruction *) node)-as_variable();

if (var  var-data.mode == ir_var_shader_in 
 -  is_varying_var(consumer-Stage, var)) {
 +  var_counts_against_varying_limit(consumer-Stage, var)) {
   input_vectors += var-type-count_attribute_slots();
}
 }
 --
Reviewed-by: Anuj Phogat anuj.pho...@gmail.com

 1.9.2

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


[Mesa-dev] [PATCH] glsl: Rename linker's is_varying_var

2014-05-08 Thread Chris Forbes
Both the ast-IR and linker have functions with this name, but different
behavior.

Rename the linker's version to var_counts_against_varying_limit to be
closer to what it is actually used for.

Suggested by Ian a while back.

Signed-off-by: Chris Forbes chr...@ijw.co.nz
---

Note that there's actually a bug lurking in here -- check_against_output_limit 
won't actually count anything, since it requires var-data.mode == 
ir_var_shader_out and stage != MESA_SHADER_FRAGMENT.

 src/glsl/link_varyings.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index ac38a2f..71998df 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -992,7 +992,7 @@ varying_matches::match_comparator(const void *x_generic, 
const void *y_generic)
  * varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord.
  */
 static bool
-is_varying_var(gl_shader_stage stage, const ir_variable *var)
+var_counts_against_varying_limit(gl_shader_stage stage, const ir_variable *var)
 {
/* Only fragment shaders will take a varying variable as an input */
if (stage == MESA_SHADER_FRAGMENT 
@@ -1462,7 +1462,7 @@ check_against_output_limit(struct gl_context *ctx,
   ir_variable *const var = ((ir_instruction *) node)-as_variable();
 
   if (var  var-data.mode == ir_var_shader_out 
-  is_varying_var(producer-Stage, var)) {
+  var_counts_against_varying_limit(producer-Stage, var)) {
  output_vectors += var-type-count_attribute_slots();
   }
}
@@ -1501,7 +1501,7 @@ check_against_input_limit(struct gl_context *ctx,
   ir_variable *const var = ((ir_instruction *) node)-as_variable();
 
   if (var  var-data.mode == ir_var_shader_in 
-  is_varying_var(consumer-Stage, var)) {
+  var_counts_against_varying_limit(consumer-Stage, var)) {
  input_vectors += var-type-count_attribute_slots();
   }
}
-- 
1.9.2

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