glsl: pack 16-bit uniforms in the NIR linker

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9050>
This commit is contained in:
Marek Olšák
2021-02-12 08:14:07 -05:00
committed by Marge Bot
parent 5d32cf642f
commit 6604aa2606
+4
View File
@@ -672,6 +672,10 @@ add_parameter(struct gl_uniform_storage *uniform,
comps = 4;
}
/* TODO: This will waste space with 1 and 3 16-bit components. */
if (glsl_type_is_16bit(glsl_without_array(type)))
comps = DIV_ROUND_UP(comps, 2);
_mesa_add_parameter(params, PROGRAM_UNIFORM, uniform->name, comps,
glsl_get_gl_type(type), NULL, NULL, false);
}