freedreno: Only call nir_lower_io on shader_in/out
Gallium drivers should never see nir_var_uniform because gallium lowers regular uniforms to a UBO. No GL driver should ever see either nir_var_mem_shared because that's lowered in GLSL IR. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>
This commit is contained in:
committed by
Marge Bot
parent
fc944428bf
commit
36a9046848
@@ -278,8 +278,8 @@ ir3_finalize_nir(struct ir3_compiler *compiler, nir_shader *s)
|
||||
void
|
||||
ir3_nir_post_finalize(struct ir3_compiler *compiler, nir_shader *s)
|
||||
{
|
||||
NIR_PASS_V(s, nir_lower_io, nir_var_all, ir3_glsl_type_size,
|
||||
(nir_lower_io_options)0);
|
||||
NIR_PASS_V(s, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
|
||||
ir3_glsl_type_size, (nir_lower_io_options)0);
|
||||
|
||||
if (s->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
/* NOTE: lower load_barycentric_at_sample first, since it
|
||||
|
||||
@@ -100,8 +100,9 @@ fd2_fp_state_create(struct pipe_context *pctx,
|
||||
so->nir = (cso->type == PIPE_SHADER_IR_NIR) ? cso->ir.nir :
|
||||
tgsi_to_nir(cso->tokens, pctx->screen, false);
|
||||
|
||||
NIR_PASS_V(so->nir, nir_lower_io, nir_var_all, ir2_glsl_type_size,
|
||||
(nir_lower_io_options)0);
|
||||
NIR_PASS_V(so->nir, nir_lower_io,
|
||||
nir_var_shader_in | nir_var_shader_out,
|
||||
ir2_glsl_type_size, (nir_lower_io_options)0);
|
||||
|
||||
if (ir2_optimize_nir(so->nir, true))
|
||||
goto fail;
|
||||
@@ -137,8 +138,9 @@ fd2_vp_state_create(struct pipe_context *pctx,
|
||||
so->nir = (cso->type == PIPE_SHADER_IR_NIR) ? cso->ir.nir :
|
||||
tgsi_to_nir(cso->tokens, pctx->screen, false);
|
||||
|
||||
NIR_PASS_V(so->nir, nir_lower_io, nir_var_all, ir2_glsl_type_size,
|
||||
(nir_lower_io_options)0);
|
||||
NIR_PASS_V(so->nir, nir_lower_io,
|
||||
nir_var_shader_in | nir_var_shader_out,
|
||||
ir2_glsl_type_size, (nir_lower_io_options)0);
|
||||
|
||||
if (ir2_optimize_nir(so->nir, true))
|
||||
goto fail;
|
||||
|
||||
@@ -183,7 +183,9 @@ load_glsl(unsigned num_files, char* const* files, gl_shader_stage stage)
|
||||
|
||||
NIR_PASS_V(nir, nir_lower_system_values);
|
||||
NIR_PASS_V(nir, nir_lower_frexp);
|
||||
NIR_PASS_V(nir, nir_lower_io, nir_var_all, ir3_glsl_type_size, 0);
|
||||
NIR_PASS_V(nir, nir_lower_io,
|
||||
nir_var_shader_in | nir_var_shader_out,
|
||||
ir3_glsl_type_size, (nir_lower_io_options)0);
|
||||
NIR_PASS_V(nir, gl_nir_lower_samplers, prog);
|
||||
|
||||
return nir;
|
||||
@@ -475,8 +477,9 @@ int main(int argc, char **argv)
|
||||
} else if (from_spirv) {
|
||||
nir = load_spirv(filenames[0], entry, stage);
|
||||
|
||||
NIR_PASS_V(nir, nir_lower_io, nir_var_all, ir3_glsl_type_size,
|
||||
(nir_lower_io_options)0);
|
||||
NIR_PASS_V(nir, nir_lower_io,
|
||||
nir_var_shader_in | nir_var_shader_out,
|
||||
ir3_glsl_type_size, (nir_lower_io_options)0);
|
||||
|
||||
/* TODO do this somewhere else */
|
||||
nir_lower_int64(nir, ~0);
|
||||
|
||||
Reference in New Issue
Block a user