summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-05-23 22:01:53 +1000
committerTimothy Arceri <[email protected]>2017-05-25 12:20:57 +1000
commitc8a3bac8205108e47cbff05d0c19c53965c0e6bd (patch)
treee7836bebb5c8ea3d4ac3ecccd7b804cb0398a80f /src/mesa
parentfd461b22e9573ba1bf7d86aa22569ace99e033ab (diff)
mesa: remove unrequired double calc
type_size() will already handle this correctly for us. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 3299ab722a2..4c30bea2f23 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2445,20 +2445,10 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
const enum glsl_interface_packing,
bool /* last_field */)
{
- unsigned int size;
-
/* atomics don't get real storage */
if (type->contains_atomic())
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;
if (type->without_array()->is_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);
if (index < 0) {
+ unsigned size = type_size(type) * 4;
+
index = _mesa_add_parameter(params, file, name, size, type->gl_type,
NULL, NULL);