From 6a553bedcc1093d899944022739578106eca2f30 Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Tue, 26 Feb 2019 22:29:27 -0800 Subject: [PATCH] st/nir: count num_uniforms for FS bultin shader Usually the uniforms will be assigned locations and have their slots counted automatically, but for builtin shaders the location assignment is manual. So count them too otherwise we get num_uniforms == 0. Reviewed-by: Kenneth Graunke --- src/mesa/state_tracker/st_pbo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/state_tracker/st_pbo.c b/src/mesa/state_tracker/st_pbo.c index 9b3628c0ddb..ddea8ec29e1 100644 --- a/src/mesa/state_tracker/st_pbo.c +++ b/src/mesa/state_tracker/st_pbo.c @@ -447,6 +447,7 @@ create_fs_nir(struct st_context *st, /* param = [ -xoffset + skip_pixels, -yoffset, stride, image_height ] */ nir_variable *param_var = nir_variable_create(b.shader, nir_var_uniform, glsl_vec4_type(), "param"); + b.shader->num_uniforms += 4; nir_ssa_def *param = nir_load_var(&b, param_var); nir_variable *fragcoord = @@ -496,6 +497,7 @@ create_fs_nir(struct st_context *st, nir_variable *layer_offset_var = nir_variable_create(b.shader, nir_var_uniform, glsl_int_type(), "layer_offset"); + b.shader->num_uniforms += 1; layer_offset_var->data.driver_location = 4; nir_ssa_def *layer_offset = nir_load_var(&b, layer_offset_var); -- 2.30.2