st/nir: count num_uniforms for FS bultin shader
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 27 Feb 2019 06:29:27 +0000 (22:29 -0800)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 28 Feb 2019 06:18:24 +0000 (22:18 -0800)
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 <kenneth@whitecape.org>
src/mesa/state_tracker/st_pbo.c

index 9b3628c0ddb903ace7d2a6cb900e0abaa8c81f2b..ddea8ec29e169562e786289109542aae1d5cfa29 100644 (file)
@@ -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);