[Mesa-dev] [PATCH 12/14] i965: Add uses_dfdy to brw_scalar_prog_data
Kenneth Graunke
kenneth at whitecape.org
Tue Sep 2 12:22:31 PDT 2014
On Monday, September 01, 2014 09:44:36 AM Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140902/71998e66/attachment.sig>
More information about the mesa-dev
mailing list