[Mesa-dev] [PATCH 1/1] i965: Do not overwrite optimizer dumps
Kenneth Graunke
kenneth at whitecape.org
Wed Nov 25 10:49:32 PST 2015
On Wednesday, November 25, 2015 10:31:24 AM Matt Turner wrote:
> On Wed, Nov 25, 2015 at 4:15 AM, Juan A. Suarez Romero
> <jasuarez at igalia.com> wrote:
> > When using INTEL_DEBUG=optimizer, each optimizing step is dump to disk,
> > in a separate file.
> >
> > But as fs_visitor::optimize() and vec4_visitor::run() are called more
> > than once, it ends up overwriting the files already on disk, loosing
> > then previous optimizer steps.
>
> Huh. I guess this happens when non-orthogonal state changes and we
> recompile the program?
>
> If so, yeah, that would lead to some confusing results.
>
> > To avoid this, add a new static variable that tracks the global
> > iteration across the entire life of the program running.
> > ---
> > src/mesa/drivers/dri/i965/brw_fs.cpp | 13 +++++++++----
> > src/mesa/drivers/dri/i965/brw_vec4.cpp | 11 +++++++----
> > 2 files changed, 16 insertions(+), 8 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > index 29f19cc..9520a62 100644
> > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > @@ -4947,6 +4947,8 @@ fs_visitor::calculate_register_pressure()
> > void
> > fs_visitor::optimize()
> > {
> > + static int global_iteration = 0;
>
> I don't know that adding a static variable is the way to solve this. I
> know this is debugging code, but using a static variable will make
> this thread-unsafe, and I *really* don't want to end up in a situation
> where I can't figure out what the optimizer is doing because we were
> compiling shaders in parallel...
>
> Ken, any ideas?
It almost seems like you want a hash of the program key - and maybe a
file containing a printed copy of the key so you can identify which
program is which.
Alternatively, one could use the address of the key with %p to obtain
a unique identifier. That's easy and should solve the problem.
--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/20151125/326360f6/attachment-0001.sig>
More information about the mesa-dev
mailing list