[Mesa-dev] [PATCH 01/95] i965/nir: double/dvec2 uniforms only need to be padded to a single vec4 slot

Iago Toral Quiroga itoral at igalia.com
Tue Jul 19 10:39:58 UTC 2016


From: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

max_vector_size is used in the vec4 backend to pad out the uniform
components to match a size that is a multiple of a vec4. Double and dvec2
uniforms only require a single vec4 slot, not two.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Signed-off-by: Iago Toral Quiroga <itoral at igalia.com>
---
 src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
index b752ad5..e3ce5f9 100644
--- a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
+++ b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
@@ -107,7 +107,8 @@ brw_nir_setup_glsl_uniform(gl_shader_stage stage, nir_variable *var,
          unsigned max_vector_size = 4;
          if (storage->type->base_type == GLSL_TYPE_DOUBLE) {
             vector_size *= 2;
-            max_vector_size *= 2;
+            if (vector_size > 4)
+               max_vector_size = 8;
          }
 
          for (unsigned s = 0; s < vector_count; s++) {
-- 
2.7.4



More information about the mesa-dev mailing list