st: Lower uniforms in st in the !PIPE_CAP_PACKED_UNIFORMS case as well.
authorEric Anholt <eric@anholt.net>
Mon, 8 Apr 2019 23:32:01 +0000 (16:32 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 10 Apr 2019 18:44:20 +0000 (11:44 -0700)
commit771adffec1b6e504367b83c121efd0fb657bb262
tree0e95d2b60b3492afcaf32aa332667749a194db27
parent3053d5a4f2fd6f81a6fb8d398afeaca91c7692e8
st: Lower uniforms in st in the !PIPE_CAP_PACKED_UNIFORMS case as well.

PIPE_CAP_PACKED_UNIFORMS conflates several things: Lowering uniforms i/o
at the st level instead of the backend, packing uniforms with no padding
at all, and lowering to UBOs.

Requiring backends to lower uniforms i/o for !PIPE_CAP_PACKED_UNIFORMS
leads to the driver needing to either link against the type size function
in mesa/st, or duplicating it in the backend.  Given that all backends
want this lower-io as far as I can tell, just move it to mesa/st to
resolve the link issue and avoid the driver author needing to understand
st's uniforms layout.

Incidentally, fixes uniform layout failures in nouveau in:

dEQP-GLES2.functional.shaders.struct.uniform.sampler_nested_fragment
dEQP-GLES2.functional.shaders.struct.uniform.sampler_nested_vertex
dEQP-GLES2.functional.shaders.struct.uniform.sampler_array_fragment
dEQP-GLES2.functional.shaders.struct.uniform.sampler_array_vertex

and I think in Lima as well.

v2: fix indents

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/panfrost/midgard/midgard_compile.c
src/gallium/drivers/v3d/v3d_program.c
src/gallium/drivers/vc4/vc4_program.c
src/mesa/state_tracker/st_glsl_to_nir.cpp
src/mesa/state_tracker/st_glsl_types.cpp
src/mesa/state_tracker/st_glsl_types.h
src/mesa/state_tracker/st_nir_builtins.c