Re: [Mesa-dev] [PATCH 3/8] glsl: use dual slot helper in the linker code.

2015-12-09 Thread Timothy Arceri
On Wed, 2015-12-09 at 16:06 +1000, Dave Airlie wrote:
> From: Dave Airlie 
> 
> Signed-off-by: Dave Airlie 

Great timing :) I was going to have to look into fixing this stuff for
enhanced layouts.

Patches 1 & 2 are:
Reviewed-by: Timothy Arceri 

I have a question about this patch. If these doubles only take up a
single attribute then why do we even bother with this test? The spec
says its optional and your fixing the counting up in later patches so
what does it do thats useful?

If there is a good reason for keeping it then:
Reviewed-by: Timothy Arceri 

> ---
>  src/glsl/linker.cpp | 11 +--
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index ae628cd..89659c7 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2603,17 +2603,8 @@
> assign_attribute_or_color_locations(gl_shader_program *prog,
>   * issue (3) of the GL_ARB_vertex_attrib_64bit behavior,
> this
>   * is optional behavior, but it seems preferable.
>   */
> -const glsl_type *type = var->type->without_array();
> -if (type == glsl_type::dvec3_type ||
> -type == glsl_type::dvec4_type ||
> -type == glsl_type::dmat2x3_type ||
> -type == glsl_type::dmat2x4_type ||
> -type == glsl_type::dmat3_type ||
> -type == glsl_type::dmat3x4_type ||
> -type == glsl_type::dmat4x3_type ||
> -type == glsl_type::dmat4_type) {
> +if (var->type->without_array()->is_dual_slot_double())
> double_storage_locations |= (use_mask << attr);
> -}
>}
>  
>continue;
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/8] glsl: use dual slot helper in the linker code.

2015-12-09 Thread Dave Airlie
On 9 December 2015 at 21:39, Timothy Arceri  wrote:
> On Wed, 2015-12-09 at 16:06 +1000, Dave Airlie wrote:
>> From: Dave Airlie 
>>
>> Signed-off-by: Dave Airlie 
>
> Great timing :) I was going to have to look into fixing this stuff for
> enhanced layouts.
>
> Patches 1 & 2 are:
> Reviewed-by: Timothy Arceri 
>
> I have a question about this patch. If these doubles only take up a
> single attribute then why do we even bother with this test? The spec
> says its optional and your fixing the counting up in later patches so
> what does it do thats useful?

It's complicated.

ARB_gpu_shader_fp64 passes doubles between shaders, dual slots ones
take two locations. So a dvec3[2] will consume locations 17/18, 19/20.
The limits
are in number of locations.

ARB_vertex_attrib_64bit allows doubles as vertex inputs. Dual slot ones
take up a single location, however they consume two slots with respect
to the hw limits. So a dvec3[2] will consume 17, 18. However it will take
4 slots against the vertex attrib limits.

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


[Mesa-dev] [PATCH 3/8] glsl: use dual slot helper in the linker code.

2015-12-08 Thread Dave Airlie
From: Dave Airlie 

Signed-off-by: Dave Airlie 
---
 src/glsl/linker.cpp | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index ae628cd..89659c7 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2603,17 +2603,8 @@ assign_attribute_or_color_locations(gl_shader_program 
*prog,
  * issue (3) of the GL_ARB_vertex_attrib_64bit behavior, this
  * is optional behavior, but it seems preferable.
  */
-const glsl_type *type = var->type->without_array();
-if (type == glsl_type::dvec3_type ||
-type == glsl_type::dvec4_type ||
-type == glsl_type::dmat2x3_type ||
-type == glsl_type::dmat2x4_type ||
-type == glsl_type::dmat3_type ||
-type == glsl_type::dmat3x4_type ||
-type == glsl_type::dmat4x3_type ||
-type == glsl_type::dmat4_type) {
+if (var->type->without_array()->is_dual_slot_double())
double_storage_locations |= (use_mask << attr);
-}
 }
 
 continue;
-- 
2.5.0

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