diff options
author | Connor Abbott <cwabbott0@gmail.com> | 2015-11-02 00:02:54 -0500 |
---|---|---|
committer | Samuel Iglesias Gonsálvez <siglesias@igalia.com> | 2016-04-29 09:47:01 +0200 |
commit | 80c2487fbdf6277c422235b1580c8610f567a021 (patch) | |
tree | 7be72f24e32dbedf99093cb3c160dd17171e7130 | |
parent | 6d90d5157a6bfc6db7b0a565855b5998b0fae695 (diff) |
i965: fixup uniform setup for doubles
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp index 636340add3..15d99fa273 100644 --- a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp +++ b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp @@ -104,6 +104,11 @@ brw_nir_setup_glsl_uniform(gl_shader_stage stage, nir_variable *var, unsigned vector_count = (MAX2(storage->array_elements, 1) * storage->type->matrix_columns); unsigned vector_size = storage->type->vector_elements; + unsigned max_vector_size = 4; + if (storage->type->base_type == GLSL_TYPE_DOUBLE) { + vector_size *= 2; + max_vector_size *= 2; + } for (unsigned s = 0; s < vector_count; s++) { unsigned i; @@ -113,7 +118,7 @@ brw_nir_setup_glsl_uniform(gl_shader_stage stage, nir_variable *var, if (!is_scalar) { /* Pad out with zeros if needed (only needed for vec4) */ - for (; i < 4; i++) { + for (; i < max_vector_size; i++) { static const gl_constant_value zero = { 0.0 }; stage_prog_data->param[uniform_index++] = &zero; } |