Re: [Mesa-dev] [PATCH] glsl: Drop bogus is_vertex_input from add_shader_variable().

2016-12-19 Thread Anuj Phogat
On Fri, Dec 16, 2016 at 9:46 PM, Kenneth Graunke  wrote:
>
> stage_mask is a bitmask of shader stages, so the proper comparison would
> be (1 << MESA_SHADER_VERTEX), not MESA_SHADER_VERTEX itself.
>
> But we only care for structure types, and VS inputs cannot be structs.
> So we can just drop this entirely.
>
> Signed-off-by: Kenneth Graunke 
> ---
>  src/compiler/glsl/linker.cpp | 7 +--
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> Sorry, I forgot I split this into two patches...apply this one before
> [PATCH] glsl: Fix program interface queries relating to interface blocks.
>
> diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
> index 3660257..5066014 100644
> --- a/src/compiler/glsl/linker.cpp
> +++ b/src/compiler/glsl/linker.cpp
> @@ -3735,10 +3735,6 @@ add_shader_variable(const struct gl_context *ctx,
>  bool use_implicit_location, int location,
>  const glsl_type *outermost_struct_type = NULL)
>  {
> -   const bool is_vertex_input =
> -  programInterface == GL_PROGRAM_INPUT &&
> -  stage_mask == MESA_SHADER_VERTEX;
> -
> switch (type->base_type) {
> case GLSL_TYPE_STRUCT: {
>/* The ARB_program_interface_query spec says:
> @@ -3764,8 +3760,7 @@ add_shader_variable(const struct gl_context *ctx,
>outermost_struct_type))
>  return false;
>
> - field_location +=
> -field->type->count_attribute_slots(is_vertex_input);
> + field_location += field->type->count_attribute_slots(false);
>}
>return true;
> }
> --
> 2.10.2
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Anuj Phogat 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: Drop bogus is_vertex_input from add_shader_variable().

2016-12-19 Thread Alejandro Piñeiro
lgtm

Reviewed-by: Alejandro Piñeiro 

On 17/12/16 03:46, Kenneth Graunke wrote:
> stage_mask is a bitmask of shader stages, so the proper comparison would
> be (1 << MESA_SHADER_VERTEX), not MESA_SHADER_VERTEX itself.
>
> But we only care for structure types, and VS inputs cannot be structs.
> So we can just drop this entirely.
>
> Signed-off-by: Kenneth Graunke 
> ---
>  src/compiler/glsl/linker.cpp | 7 +--
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> Sorry, I forgot I split this into two patches...apply this one before
> [PATCH] glsl: Fix program interface queries relating to interface blocks.
>
> diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
> index 3660257..5066014 100644
> --- a/src/compiler/glsl/linker.cpp
> +++ b/src/compiler/glsl/linker.cpp
> @@ -3735,10 +3735,6 @@ add_shader_variable(const struct gl_context *ctx,
>  bool use_implicit_location, int location,
>  const glsl_type *outermost_struct_type = NULL)
>  {
> -   const bool is_vertex_input =
> -  programInterface == GL_PROGRAM_INPUT &&
> -  stage_mask == MESA_SHADER_VERTEX;
> -
> switch (type->base_type) {
> case GLSL_TYPE_STRUCT: {
>/* The ARB_program_interface_query spec says:
> @@ -3764,8 +3760,7 @@ add_shader_variable(const struct gl_context *ctx,
>outermost_struct_type))
>  return false;
>  
> - field_location +=
> -field->type->count_attribute_slots(is_vertex_input);
> + field_location += field->type->count_attribute_slots(false);
>}
>return true;
> }

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


[Mesa-dev] [PATCH] glsl: Drop bogus is_vertex_input from add_shader_variable().

2016-12-16 Thread Kenneth Graunke
stage_mask is a bitmask of shader stages, so the proper comparison would
be (1 << MESA_SHADER_VERTEX), not MESA_SHADER_VERTEX itself.

But we only care for structure types, and VS inputs cannot be structs.
So we can just drop this entirely.

Signed-off-by: Kenneth Graunke 
---
 src/compiler/glsl/linker.cpp | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

Sorry, I forgot I split this into two patches...apply this one before
[PATCH] glsl: Fix program interface queries relating to interface blocks.

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 3660257..5066014 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3735,10 +3735,6 @@ add_shader_variable(const struct gl_context *ctx,
 bool use_implicit_location, int location,
 const glsl_type *outermost_struct_type = NULL)
 {
-   const bool is_vertex_input =
-  programInterface == GL_PROGRAM_INPUT &&
-  stage_mask == MESA_SHADER_VERTEX;
-
switch (type->base_type) {
case GLSL_TYPE_STRUCT: {
   /* The ARB_program_interface_query spec says:
@@ -3764,8 +3760,7 @@ add_shader_variable(const struct gl_context *ctx,
   outermost_struct_type))
 return false;
 
- field_location +=
-field->type->count_attribute_slots(is_vertex_input);
+ field_location += field->type->count_attribute_slots(false);
   }
   return true;
}
-- 
2.10.2

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