[Mesa-dev] [PATCH] mesa/i965: remove _CurrentFragmentProgram from gl_pipeline_object

Kenneth Graunke kenneth at whitecape.org
Thu May 11 04:36:56 UTC 2017


On Tuesday, May 9, 2017 6:57:53 PM PDT Timothy Arceri wrote:
> This was added in b527dd65c830a as a work around because fixed function
> fragment shaders were tracked in ctx->FragmentProgram._Current as
> a gl_program rather than gl_shader_program.
> 
> However after my refactoring of the program and shader structs
> at the end of 2016 which culminated in c505d6d85222, we no longer
> need gl_shader_program to track the current program making
> _CurrentFragmentProgram obsolete.
> ---
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c |  3 +--
>  src/mesa/main/api_validate.c                     |  2 +-
>  src/mesa/main/mtypes.h                           |  2 --
>  src/mesa/main/pipelineobj.c                      |  2 --
>  src/mesa/main/shaderapi.c                        | 22 ----------------------
>  src/mesa/main/state.c                            |  8 --------
>  6 files changed, 2 insertions(+), 37 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> index 49383c7..cad9c1c 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -1434,23 +1434,22 @@ brw_upload_ubo_surfaces(struct brw_context *brw, struct gl_program *prog,
>        }
>     }
>  
>     if (prog->info.num_ubos || prog->info.num_ssbos)
>        brw->ctx.NewDriverState |= BRW_NEW_SURFACES;
>  }
>  
>  static void
>  brw_upload_wm_ubo_surfaces(struct brw_context *brw)
>  {
> -   struct gl_context *ctx = &brw->ctx;
>     /* _NEW_PROGRAM */
> -   struct gl_program *prog = ctx->_Shader->_CurrentFragmentProgram;
> +   struct gl_program *prog = brw->fragment_program;

I'd make this ctx->FragmentProgram._Current.

I'd also drop 'i965' from the commit title - 'mesa: ' is fine.

Eventually we should switch everything over to brw->*_program instead of
ctx->*Program*, and BRW_NEW_*_PROGRAM instead of _NEW_PROGRAM.  But
we're also in the middle of rewriting a lot of the state upload code
here, so I think it's fine to put that off for another day :)

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170510/65858d35/attachment-0001.sig>


More information about the mesa-dev mailing list