Mesa (master): gallivm/nir: Lower uniforms to UBOs in llvm draw if the driver didn't request this already
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 3 05:04:36 UTC 2020
Module: Mesa
Branch: master
Commit: 63bff6a9f89d6b8fa3a57253edb2611dd4e226bc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=63bff6a9f89d6b8fa3a57253edb2611dd4e226bc
Author: Gert Wollny <gert.wollny at collabora.com>
Date: Sun Jun 28 18:18:19 2020 +0200
gallivm/nir: Lower uniforms to UBOs in llvm draw if the driver didn't request this already
When the llvm draw engine is used for draw shaders in st_program the driver
may not enable the cap PIPE_CAP_PACKED_UNIFORMS, so uniforms are not
be lowered to UBOs. However, llvm doesn't support nir_load_uniform, so lower
the uniforms to UBO now. The multiplier is set to 16 to be the same like in
the TGSI code path.
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5681>
---
src/gallium/auxiliary/draw/draw_vs_llvm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/auxiliary/draw/draw_vs_llvm.c b/src/gallium/auxiliary/draw/draw_vs_llvm.c
index ec3c5b00fbc..42551b93381 100644
--- a/src/gallium/auxiliary/draw/draw_vs_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_vs_llvm.c
@@ -98,6 +98,8 @@ draw_create_vs_llvm(struct draw_context *draw,
for ir.nir & PIPE_SHADER_IR_NIR here. */
if (state->ir.nir && state->type == PIPE_SHADER_IR_NIR) {
vs->base.state.ir.nir = state->ir.nir;
+ if (!draw->pipe->screen->get_param(draw->pipe->screen, PIPE_CAP_PACKED_UNIFORMS))
+ NIR_PASS_V(state->ir.nir, nir_lower_uniforms_to_ubo, 16);
nir_tgsi_scan_shader(state->ir.nir, &vs->base.info, true);
} else {
/* we make a private copy of the tokens */
More information about the mesa-commit
mailing list