diff options
author | Eric Anholt <[email protected]> | 2019-04-08 16:32:01 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-04-10 11:44:20 -0700 |
commit | 771adffec1b6e504367b83c121efd0fb657bb262 (patch) | |
tree | 0e95d2b60b3492afcaf32aa332667749a194db27 /src/mesa/state_tracker/st_nir_builtins.c | |
parent | 3053d5a4f2fd6f81a6fb8d398afeaca91c7692e8 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_nir_builtins.c')
-rw-r--r-- | src/mesa/state_tracker/st_nir_builtins.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_nir_builtins.c b/src/mesa/state_tracker/st_nir_builtins.c index 8ec320cbb9c..01663b702ac 100644 --- a/src/mesa/state_tracker/st_nir_builtins.c +++ b/src/mesa/state_tracker/st_nir_builtins.c @@ -67,6 +67,9 @@ st_nir_finish_builtin_shader(struct st_context *st, NIR_PASS_V(nir, nir_lower_io, nir_var_uniform, st_glsl_type_dword_size, (nir_lower_io_options)0); NIR_PASS_V(nir, nir_lower_uniforms_to_ubo, 4); + } else { + NIR_PASS_V(nir, nir_lower_io, nir_var_uniform, st_glsl_uniforms_type_size, + (nir_lower_io_options)0); } struct pipe_shader_state state = { |