Re: [Mesa-dev] [PATCH 1/2] mesa: Track max enabled tex image unit

2014-04-18 Thread Ian Romanick
Series is

Reviewed-by: Ian Romanick 

On 04/12/2014 05:37 PM, Chris Forbes wrote:
> This gives us a better bound for some hot loops in the drivers than
> MAX_COMBINED_TEXTURE_IMAGE_UNITS, which is ridiculously large on modern
> hardware, and only getting worse as more shader stages are added.
> 
> Signed-off-by: Chris Forbes 
> ---
>  src/mesa/main/mtypes.h   | 3 +++
>  src/mesa/main/texstate.c | 2 ++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 4d014d1..6694383 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -1402,6 +1402,9 @@ struct gl_texture_attrib
>  
> /** Bitwise-OR of all Texture.Unit[i]._GenFlags */
> GLbitfield _GenFlags;
> +
> +   /** Upper bound on _ReallyEnabled texunits. */
> +   GLint _MaxEnabledTexImageUnit;
>  };
>  
>  
> diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
> index fcae878..b68920c 100644
> --- a/src/mesa/main/texstate.c
> +++ b/src/mesa/main/texstate.c
> @@ -550,6 +550,7 @@ update_texture_state( struct gl_context *ctx )
> ctx->Texture._GenFlags = 0x0;
> ctx->Texture._TexMatEnabled = 0x0;
> ctx->Texture._TexGenEnabled = 0x0;
> +   ctx->Texture._MaxEnabledTexImageUnit = -1;
>  
> /*
>  * Update texture unit state.
> @@ -636,6 +637,7 @@ update_texture_state( struct gl_context *ctx )
>/* if we get here, we know this texture unit is enabled */
>  
>ctx->Texture._EnabledUnits |= (1 << unit);
> +  ctx->Texture._MaxEnabledTexImageUnit = unit;
>  
>if (enabledTargetsByStage[MESA_SHADER_FRAGMENT])
>   enabledFragUnits |= (1 << unit);
> 

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


Re: [Mesa-dev] [PATCH 1/2] mesa: Track max enabled tex image unit

2014-04-14 Thread Anuj Phogat
On Sat, Apr 12, 2014 at 5:37 PM, Chris Forbes  wrote:
>
> This gives us a better bound for some hot loops in the drivers than
> MAX_COMBINED_TEXTURE_IMAGE_UNITS, which is ridiculously large on modern
> hardware, and only getting worse as more shader stages are added.
>
> Signed-off-by: Chris Forbes 
> ---
>  src/mesa/main/mtypes.h   | 3 +++
>  src/mesa/main/texstate.c | 2 ++
>  2 files changed, 5 insertions(+)
>
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 4d014d1..6694383 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -1402,6 +1402,9 @@ struct gl_texture_attrib
>
> /** Bitwise-OR of all Texture.Unit[i]._GenFlags */
> GLbitfield _GenFlags;
> +
> +   /** Upper bound on _ReallyEnabled texunits. */
> +   GLint _MaxEnabledTexImageUnit;
>  };
>
>
> diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
> index fcae878..b68920c 100644
> --- a/src/mesa/main/texstate.c
> +++ b/src/mesa/main/texstate.c
> @@ -550,6 +550,7 @@ update_texture_state( struct gl_context *ctx )
> ctx->Texture._GenFlags = 0x0;
> ctx->Texture._TexMatEnabled = 0x0;
> ctx->Texture._TexGenEnabled = 0x0;
> +   ctx->Texture._MaxEnabledTexImageUnit = -1;
>
> /*
>  * Update texture unit state.
> @@ -636,6 +637,7 @@ update_texture_state( struct gl_context *ctx )
>/* if we get here, we know this texture unit is enabled */
>
>ctx->Texture._EnabledUnits |= (1 << unit);
> +  ctx->Texture._MaxEnabledTexImageUnit = unit;
>
>if (enabledTargetsByStage[MESA_SHADER_FRAGMENT])
>   enabledFragUnits |= (1 << unit);
> --
> 1.9.2
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Looks good to me.
Reviewed-by: Anuj Phogat 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] mesa: Track max enabled tex image unit

2014-04-12 Thread Chris Forbes
This gives us a better bound for some hot loops in the drivers than
MAX_COMBINED_TEXTURE_IMAGE_UNITS, which is ridiculously large on modern
hardware, and only getting worse as more shader stages are added.

Signed-off-by: Chris Forbes 
---
 src/mesa/main/mtypes.h   | 3 +++
 src/mesa/main/texstate.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 4d014d1..6694383 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1402,6 +1402,9 @@ struct gl_texture_attrib
 
/** Bitwise-OR of all Texture.Unit[i]._GenFlags */
GLbitfield _GenFlags;
+
+   /** Upper bound on _ReallyEnabled texunits. */
+   GLint _MaxEnabledTexImageUnit;
 };
 
 
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index fcae878..b68920c 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -550,6 +550,7 @@ update_texture_state( struct gl_context *ctx )
ctx->Texture._GenFlags = 0x0;
ctx->Texture._TexMatEnabled = 0x0;
ctx->Texture._TexGenEnabled = 0x0;
+   ctx->Texture._MaxEnabledTexImageUnit = -1;
 
/*
 * Update texture unit state.
@@ -636,6 +637,7 @@ update_texture_state( struct gl_context *ctx )
   /* if we get here, we know this texture unit is enabled */
 
   ctx->Texture._EnabledUnits |= (1 << unit);
+  ctx->Texture._MaxEnabledTexImageUnit = unit;
 
   if (enabledTargetsByStage[MESA_SHADER_FRAGMENT])
  enabledFragUnits |= (1 << unit);
-- 
1.9.2

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