Browse Source

i965: Always compile fp64 funcs when needed

Compilation of user-specified shaders with software fp64 works by
compiling on demand an "fp64-funcs" shader implementing various fp64
operations and then linking it into the "user shader".

In

   commit 64b8c86d37
   Author: Timothy Arceri <tarceri@itsqueeze.com>
   Date:   Thu Jan 17 17:16:29 2019 +1100

       glsl: be much more aggressive when skipping shader compilation

we changed the behavior of the shader cache to skip compilation earlier
when we get a cache hit.

After the aforementioned commit, compiling a user program using fp64
would store into the cache an entry for the fp64-funcs shader.
Subsequent compilations of uncached user shaders using fp64 would fail
in compile_fp64_funcs() after finding a cache entry for the fp64-funcs,
but being unprepared to read from the cache.

It's unclear to me how to retrieve the cached NIR of the fp64-funcs (if
it even is cached), so just call _mesa_glsl_compile_shader() with
force_recompile=true in order to ensure we generate the fp64-funcs
successfully.

Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
tags/19.0-branchpoint
Matt Turner 6 years ago
parent
commit
a7d629a590
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/mesa/drivers/dri/i965/brw_program.c

+ 2
- 1
src/mesa/drivers/dri/i965/brw_program.c View File

@@ -40,6 +40,7 @@
#include "tnl/tnl.h"
#include "util/ralloc.h"
#include "compiler/glsl/ir.h"
#include "compiler/glsl/program.h"
#include "compiler/glsl/glsl_to_nir.h"
#include "compiler/glsl/float64_glsl.h"

@@ -87,7 +88,7 @@ compile_fp64_funcs(struct gl_context *ctx,

sh->Source = float64_source;
sh->CompileStatus = COMPILE_FAILURE;
_mesa_compile_shader(ctx, sh);
_mesa_glsl_compile_shader(ctx, sh, false, false, true);

if (!sh->CompileStatus) {
if (sh->InfoLog) {

Loading…
Cancel
Save