i965/nir: double/dvec2 uniforms only need to be padded to a single vec4 slot
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 6 Jun 2016 13:49:52 +0000 (15:49 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 3 Jan 2017 10:26:50 +0000 (11:26 +0100)
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@igalia.com>
Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp

index 15a608c857a022e94acdeaecef22852330730af9..2407bac86cce93e7ce01179458810f884228c763 100644 (file)
@@ -108,7 +108,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++) {