On Monday, September 01, 2014 09:44:36 AM Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_context.h            | 1 +
>  src/mesa/drivers/dri/i965/brw_scalar_generator.cpp | 4 ++--
>  src/mesa/drivers/dri/i965/brw_wm.c                 | 1 +
>  3 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
> b/src/mesa/drivers/dri/i965/brw_context.h
> index a5705ca..1705a7f 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -346,6 +346,7 @@ struct brw_scalar_prog_data {
>     bool uses_pos_offset;
>     bool uses_omask;
>     bool uses_kill;
> +   bool uses_dfdy;
>     uint32_t prog_offset_16;
>  
>     /**
> diff --git a/src/mesa/drivers/dri/i965/brw_scalar_generator.cpp 
> b/src/mesa/drivers/dri/i965/brw_scalar_generator.cpp
> index 453f4d0..e8a43df 100644
> --- a/src/mesa/drivers/dri/i965/brw_scalar_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_scalar_generator.cpp
> @@ -1804,10 +1804,10 @@ scalar_generator::generate_code(const cfg_t *cfg)
>        generate_ddx(inst, dst, src[0], src[1]);
>        break;
>        case FS_OPCODE_DDY:
> -         /* Make sure fp->UsesDFdy flag got set (otherwise there's no
> +         /* Make sure prog_data->uses_dfdy flag got set (otherwise there's no
>            * guarantee that key->render_to_fbo is set).
>            */
> -         assert(fp->UsesDFdy);
> +         assert(prog_data->uses_dfdy);
>        generate_ddy(inst, dst, src[0], src[1], key->render_to_fbo);
>        break;
>  
> diff --git a/src/mesa/drivers/dri/i965/brw_wm.c 
> b/src/mesa/drivers/dri/i965/brw_wm.c
> index 375334d..215872c 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm.c
> @@ -158,6 +158,7 @@ bool do_wm_prog(struct brw_context *brw,
>  
>     memset(&prog_data, 0, sizeof(prog_data));
>     prog_data.base.uses_kill = fp->program.UsesKill;
> +   prog_data.base.uses_dfdy = fp->program.UsesDFdy;
>  
>     /* Allocate the references to the uniforms that will end up in the
>      * prog_data associated with the compiled program, and which will be freed
> 

I don't think we should add uses_dfdy to the prog_data structure - it's not 
useful other than for this assertion.  For example, state upload code doesn't 
depend on it at all...nor does the final code generation.

Instead, I think we could move the assert(fp->UsesDFdy) to fs_visitor, in the 
places that emit FS_OPCODE_DDY.  That would drop the generator dependency on 
"fp" as well.

--Ken

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to