diff options
author | Timothy Arceri <[email protected]> | 2019-10-30 11:24:37 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2019-11-01 11:33:33 +1100 |
commit | 0e186c18ba1157ae9dc6c1d6256925ceeab00344 (patch) | |
tree | 394afcdf37585531baa63e81deab26731cc17cb3 /src/mesa | |
parent | 8fa13db25163d36460d779dd4ea0ede19227cdbf (diff) |
glsl: just use NIR to lower outputs when driver can't read outputs
This will allow us to stop lowering gl_FragData in GLSL IR for NIR
drivers which means we won't need the special GLSL IR type
handling for building the resource list in a NIR based linker.
i965 has been doing this since b828f7a27b2b.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 0e249377ce6..d0ca8b0877b 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -340,6 +340,7 @@ st_nir_preprocess(struct st_context *st, struct gl_program *prog, struct gl_shader_program *shader_program, gl_shader_stage stage) { + struct pipe_screen *screen = st->pipe->screen; const nir_shader_compiler_options *options = st->ctx->Const.ShaderCompilerOptions[prog->info.stage].NirOptions; assert(options); @@ -376,7 +377,8 @@ st_nir_preprocess(struct st_context *st, struct gl_program *prog, NIR_PASS_V(nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, true); - } else if (nir->info.stage == MESA_SHADER_FRAGMENT) { + } else if (nir->info.stage == MESA_SHADER_FRAGMENT || + !screen->get_param(screen, PIPE_CAP_TGSI_CAN_READ_OUTPUTS)) { NIR_PASS_V(nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, false); @@ -660,7 +662,6 @@ st_link_nir(struct gl_context *ctx, struct gl_shader_program *shader_program) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; unsigned num_linked_shaders = 0; unsigned last_stage = 0; @@ -691,10 +692,6 @@ st_link_nir(struct gl_context *ctx, _mesa_generate_parameters_list_for_uniforms(ctx, shader_program, shader, prog->Parameters); - /* Remove reads from output registers. */ - if (!screen->get_param(screen, PIPE_CAP_TGSI_CAN_READ_OUTPUTS)) - lower_output_reads(shader->Stage, shader->ir); - if (ctx->_Shader->Flags & GLSL_DUMP) { _mesa_log("\n"); _mesa_log("GLSL IR for linked %s program %d:\n", |