[Mesa-dev] [PATCH v3 28/34] i965: add cache fallback support using serialized nir
kenneth at whitecape.org
Mon Oct 30 23:01:02 UTC 2017
On Sunday, October 29, 2017 5:21:47 PM PDT Jordan Justen wrote:
> On 2017-10-29 01:11:32, Kenneth Graunke wrote:
> > On Sunday, October 22, 2017 1:01:36 PM PDT Jordan Justen wrote:
> > > If the i965 gen program cannot be loaded from the cache, then we
> > > fallback to using a serialized nir program.
> > >
> > > This is based on "i965: add cache fallback support" by Timothy Arceri
> > > <timothy.arceri at collabora.com>. Tim's version was written to fallback
> > > to compiling from source, and therefore had to be much more complex.
> > > After Connor and Jason implemented nir serialization, I was able to
> > > rewrite and greatly simplify this patch.
> > >
> > > Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> > > Acked-by: Timothy Arceri <tarceri at itsqueeze.com>
> > > ---
> > > src/mesa/drivers/dri/i965/brw_disk_cache.c | 27 ++++++++++++++++++++++++++-
> > > 1 file changed, 26 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/mesa/drivers/dri/i965/brw_disk_cache.c b/src/mesa/drivers/dri/i965/brw_disk_cache.c
> > > index 503c6c7b499..9af893d40a7 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_disk_cache.c
> > > +++ b/src/mesa/drivers/dri/i965/brw_disk_cache.c
> > > @@ -24,6 +24,7 @@
> > > #include "compiler/blob.h"
> > > #include "compiler/glsl/ir_uniform.h"
> > > #include "compiler/glsl/shader_cache.h"
> > > +#include "compiler/nir/nir_serialize.h"
> > > #include "main/mtypes.h"
> > > #include "util/disk_cache.h"
> > > #include "util/macros.h"
> > > @@ -58,6 +59,27 @@ gen_shader_sha1(struct brw_context *brw, struct gl_program *prog,
> > > _mesa_sha1_compute(manifest, strlen(manifest), out_sha1);
> > > }
> > >
> > > +static void
> > > +fallback_to_full_recompile(struct brw_context *brw, struct gl_program *prog,
> > It's not exactly a full recompile anymore, maybe rename this to
> > recompile_from_nir? Or fallback_to_partial_recompile?
> Good point. I guess eventually we'll recompile from nir, but at this
> point we are just restoring the nir program. What about
> restore_serialized_nir_shader? Reviewed-by from you with that?
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: This is a digitally signed message part.
More information about the mesa-dev