[Mesa-dev] [PATCH 07/34] mesa: account for geometry shader texture fetches in update_texture_state

Ian Romanick idr at freedesktop.org
Wed Jul 31 18:07:07 PDT 2013


Patches 7, 9 (with Ken's suggestions), 10, 12, 13, 14, 15 (with the one 
nit accounted... 18 and perhaps other have the same issue), 17, 18, 19, 
20, 21, 22, 27, 28, 29 (though my question may affect 29 & 30), 30, 31, 
32 (with minor nits), 33, and 34 (with a minor nit).

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

I don't feel like I understand 16 very well.  Perhaps we can talk about 
it tomorrow?

On 07/28/2013 11:03 PM, Paul Berry wrote:
> From: Bryan Cain <bryancain3 at gmail.com>
>
> ---
>   src/mesa/main/texstate.c | 18 +++++++++++++-----
>   1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
> index 741985c..0f5d776 100644
> --- a/src/mesa/main/texstate.c
> +++ b/src/mesa/main/texstate.c
> @@ -528,6 +528,7 @@ update_texture_state( struct gl_context *ctx )
>      GLuint unit;
>      struct gl_program *fprog = NULL;
>      struct gl_program *vprog = NULL;
> +   struct gl_program *gprog = NULL;
>      GLbitfield enabledFragUnits = 0x0;
>
>      if (ctx->Shader.CurrentVertexProgram &&
> @@ -535,6 +536,11 @@ update_texture_state( struct gl_context *ctx )
>         vprog = ctx->Shader.CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
>      }
>
> +   if (ctx->Shader.CurrentGeometryProgram &&
> +       ctx->Shader.CurrentGeometryProgram->LinkStatus) {
> +      gprog = ctx->Shader.CurrentGeometryProgram->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program;
> +   }
> +
>      if (ctx->Shader.CurrentFragmentProgram &&
>          ctx->Shader.CurrentFragmentProgram->LinkStatus) {
>         fprog = ctx->Shader.CurrentFragmentProgram->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program;
> @@ -543,10 +549,6 @@ update_texture_state( struct gl_context *ctx )
>         fprog = &ctx->FragmentProgram.Current->Base;
>      }
>
> -   /* FINISHME: Geometry shader texture accesses should also be considered
> -    * FINISHME: here.
> -    */
> -
>      /* TODO: only set this if there are actual changes */
>      ctx->NewState |= _NEW_TEXTURE;
>
> @@ -562,6 +564,7 @@ update_texture_state( struct gl_context *ctx )
>         struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
>         GLbitfield enabledVertTargets = 0x0;
>         GLbitfield enabledFragTargets = 0x0;
> +      GLbitfield enabledGeomTargets = 0x0;
>         GLbitfield enabledTargets = 0x0;
>         GLuint texIndex;
>
> @@ -575,6 +578,10 @@ update_texture_state( struct gl_context *ctx )
>            enabledVertTargets |= vprog->TexturesUsed[unit];
>         }
>
> +      if (gprog) {
> +         enabledGeomTargets |= gprog->TexturesUsed[unit];
> +      }
> +
>         if (fprog) {
>            enabledFragTargets |= fprog->TexturesUsed[unit];
>         }
> @@ -583,7 +590,8 @@ update_texture_state( struct gl_context *ctx )
>            enabledFragTargets |= texUnit->Enabled;
>         }
>
> -      enabledTargets = enabledVertTargets | enabledFragTargets;
> +      enabledTargets = enabledVertTargets | enabledFragTargets |
> +                       enabledGeomTargets;
>
>         texUnit->_ReallyEnabled = 0x0;
>
>



More information about the mesa-dev mailing list