diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_link.cpp | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 10 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_nir.h | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_nir_builtins.c | 2 |
4 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index 2cbb1e0b879..66581b21f61 100644 --- a/src/mesa/drivers/dri/i965/brw_link.cpp +++ b/src/mesa/drivers/dri/i965/brw_link.cpp @@ -324,6 +324,8 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg) brw_shader_gather_info(prog->nir, prog); NIR_PASS_V(prog->nir, gl_nir_lower_samplers, shProg); + prog->info.textures_used = prog->nir->info.textures_used; + prog->info.textures_used_by_txf = prog->nir->info.textures_used_by_txf; NIR_PASS_V(prog->nir, gl_nir_lower_atomics, shProg, false); NIR_PASS_V(prog->nir, nir_lower_atomics_to_ssbo, prog->nir->info.num_abos); diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index b904060528b..89f7424e4db 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -848,12 +848,18 @@ st_nir_assign_varying_locations(struct st_context *st, nir_shader *nir) void st_nir_lower_samplers(struct pipe_screen *screen, nir_shader *nir, - struct gl_shader_program *shader_program) + struct gl_shader_program *shader_program, + struct gl_program *prog) { if (screen->get_param(screen, PIPE_CAP_NIR_SAMPLERS_AS_DEREF)) NIR_PASS_V(nir, gl_nir_lower_samplers_as_deref, shader_program); else NIR_PASS_V(nir, gl_nir_lower_samplers, shader_program); + + if (prog) { + prog->info.textures_used = nir->info.textures_used; + prog->info.textures_used_by_txf = nir->info.textures_used_by_txf; + } } /* Last third of preparing nir from glsl, which happens after shader @@ -891,7 +897,7 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog, NIR_PASS_V(nir, st_nir_lower_uniforms_to_ubo); } - st_nir_lower_samplers(screen, nir, shader_program); + st_nir_lower_samplers(screen, nir, shader_program, prog); } } /* extern "C" */ diff --git a/src/mesa/state_tracker/st_nir.h b/src/mesa/state_tracker/st_nir.h index 42a04a4676b..d45ab3c4474 100644 --- a/src/mesa/state_tracker/st_nir.h +++ b/src/mesa/state_tracker/st_nir.h @@ -56,7 +56,8 @@ void st_nir_assign_varying_locations(struct st_context *st, struct nir_shader *nir); void st_nir_lower_samplers(struct pipe_screen *screen, struct nir_shader *nir, - struct gl_shader_program *shader_program); + struct gl_shader_program *shader_program, + struct gl_program *prog); struct pipe_shader_state * st_nir_finish_builtin_shader(struct st_context *st, diff --git a/src/mesa/state_tracker/st_nir_builtins.c b/src/mesa/state_tracker/st_nir_builtins.c index 18dc2095d6f..3826d96a888 100644 --- a/src/mesa/state_tracker/st_nir_builtins.c +++ b/src/mesa/state_tracker/st_nir_builtins.c @@ -61,7 +61,7 @@ st_nir_finish_builtin_shader(struct st_context *st, st_nir_assign_varying_locations(st, nir); - st_nir_lower_samplers(screen, nir, NULL); + st_nir_lower_samplers(screen, nir, NULL, NULL); if (st->ctx->Const.PackedDriverUniformStorage) { NIR_PASS_V(nir, nir_lower_io, nir_var_uniform, st_glsl_type_dword_size, |