summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_pbo.c
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-02-26 22:29:27 -0800
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-02-27 22:18:24 -0800
commit6a553bedcc1093d899944022739578106eca2f30 (patch)
tree9e1bf4b3cb765e35fbb40fd55296d01fddc0d9d8 /src/mesa/state_tracker/st_pbo.c
parentb344e32cdf7064a1f2ff7ef37027edda6589404f (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_pbo.c')
-rw-r--r--src/mesa/state_tracker/st_pbo.c2
1 files changed, 2 insertions, 0 deletions
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);