diff options
author | Jason Ekstrand <[email protected]> | 2015-09-30 17:37:36 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-10-02 14:19:39 -0700 |
commit | cdf314cb21377ee7caca05bd1abab6a2b921d213 (patch) | |
tree | 48b8aedf5d9a1e9a8a6ae036195c99666b85516a /src/mesa/drivers | |
parent | 7fee8b6f055831bc070bb36d02a8b1c4d601652a (diff) |
i965/nir: Simplify uniform setup
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 19 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 21 |
2 files changed, 16 insertions, 24 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 829c663ec1d..eb0fe7b2856 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -185,20 +185,17 @@ fs_visitor::nir_setup_uniforms(nir_shader *shader) if (shader_prog) { brw_nir_setup_glsl_uniforms(shader, shader_prog, prog, stage_prog_data, true); - - foreach_list_typed(nir_variable, var, node, &shader->uniforms) { - /* UBO's and atomics don't take up space in the uniform file */ - if (var->interface_type != NULL || var->type->contains_atomic()) - continue; - - if(type_size_scalar(var->type) > 0) - param_size[var->data.driver_location] = type_size_scalar(var->type); - } } else { brw_nir_setup_arb_uniforms(shader, prog, stage_prog_data); + } + + foreach_list_typed(nir_variable, var, node, &shader->uniforms) { + /* UBO's and atomics don't take up space in the uniform file */ + if (var->interface_type != NULL || var->type->contains_atomic()) + continue; - if(prog->Parameters->NumParameters > 0) - param_size[0] = prog->Parameters->NumParameters * 4; + if (type_size_scalar(var->type) > 0) + param_size[var->data.driver_location] = type_size_scalar(var->type); } } diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp index 36bb35f91f4..8274d4842e8 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp @@ -139,22 +139,17 @@ vec4_visitor::nir_setup_uniforms(nir_shader *shader) if (shader_prog) { brw_nir_setup_glsl_uniforms(shader, shader_prog, prog, stage_prog_data, false); - - foreach_list_typed(nir_variable, var, node, &shader->uniforms) { - /* UBO's, atomics and samplers don't take up space in the - uniform file */ - if (var->interface_type != NULL || var->type->contains_atomic() || - type_size_vec4(var->type) == 0) { - continue; - } - - uniform_size[var->data.driver_location] = type_size_vec4(var->type); - } } else { brw_nir_setup_arb_uniforms(shader, prog, stage_prog_data); + } + + foreach_list_typed(nir_variable, var, node, &shader->uniforms) { + /* UBO's and atomics don't take up space in the uniform file */ + if (var->interface_type != NULL || var->type->contains_atomic()) + continue; - if(prog->Parameters->NumParameters > 0) - uniform_size[0] = prog->Parameters->NumParameters; + if (type_size_vec4(var->type) > 0) + uniform_size[var->data.driver_location] = type_size_vec4(var->type); } } |