Mesa (main): nir/nir_lower_uniforms_to_ubo: Set the explicit stride of the UBO 0 uniform.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 31 20:32:50 UTC 2021


Module: Mesa
Branch: main
Commit: 33182c555fa29de5bd70716fe0910b9a2f2187ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=33182c555fa29de5bd70716fe0910b9a2f2187ba

Author: Emma Anholt <emma at anholt.net>
Date:   Mon Aug  2 10:47:54 2021 -0700

nir/nir_lower_uniforms_to_ubo: Set the explicit stride of the UBO 0 uniform.

Normal UBOs have explicit strides on them, make our lowered one behave the
same.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12175>

---

 src/compiler/nir/nir_lower_uniforms_to_ubo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_uniforms_to_ubo.c b/src/compiler/nir/nir_lower_uniforms_to_ubo.c
index b1116e07a9d..12f835c3f0e 100644
--- a/src/compiler/nir/nir_lower_uniforms_to_ubo.c
+++ b/src/compiler/nir/nir_lower_uniforms_to_ubo.c
@@ -147,7 +147,7 @@ nir_lower_uniforms_to_ubo(nir_shader *shader, bool dword_packed, bool load_vec4)
 
       if (shader->num_uniforms > 0) {
          const struct glsl_type *type = glsl_array_type(glsl_vec4_type(),
-                                                        shader->num_uniforms, 0);
+                                                        shader->num_uniforms, 16);
          nir_variable *ubo = nir_variable_create(shader, nir_var_mem_ubo, type,
                                                  "uniform_0");
          ubo->data.binding = 0;



More information about the mesa-commit mailing list