i965/nir: Simplify uniform setup
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
7fee8b6f05
commit
cdf314cb21
|
@ -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);
|
||||
}
|
||||
|
||||
if(prog->Parameters->NumParameters > 0)
|
||||
param_size[0] = prog->Parameters->NumParameters * 4;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
if(prog->Parameters->NumParameters > 0)
|
||||
uniform_size[0] = prog->Parameters->NumParameters;
|
||||
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_vec4(var->type) > 0)
|
||||
uniform_size[var->data.driver_location] = type_size_vec4(var->type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue