mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
mesa: remove unrequired double calc
type_size() will already handle this correctly for us. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
fd461b22e9
commit
c8a3bac820
1 changed files with 2 additions and 10 deletions
|
|
@ -2445,20 +2445,10 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
|
||||||
const enum glsl_interface_packing,
|
const enum glsl_interface_packing,
|
||||||
bool /* last_field */)
|
bool /* last_field */)
|
||||||
{
|
{
|
||||||
unsigned int size;
|
|
||||||
|
|
||||||
/* atomics don't get real storage */
|
/* atomics don't get real storage */
|
||||||
if (type->contains_atomic())
|
if (type->contains_atomic())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (type->is_vector() || type->is_scalar()) {
|
|
||||||
size = type->vector_elements;
|
|
||||||
if (type->is_64bit())
|
|
||||||
size *= 2;
|
|
||||||
} else {
|
|
||||||
size = type_size(type) * 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_register_file file;
|
gl_register_file file;
|
||||||
if (type->without_array()->is_sampler()) {
|
if (type->without_array()->is_sampler()) {
|
||||||
file = PROGRAM_SAMPLER;
|
file = PROGRAM_SAMPLER;
|
||||||
|
|
@ -2468,6 +2458,8 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
|
||||||
|
|
||||||
int index = _mesa_lookup_parameter_index(params, name);
|
int index = _mesa_lookup_parameter_index(params, name);
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
|
unsigned size = type_size(type) * 4;
|
||||||
|
|
||||||
index = _mesa_add_parameter(params, file, name, size, type->gl_type,
|
index = _mesa_add_parameter(params, file, name, size, type->gl_type,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue