diff options
author | Dave Airlie <[email protected]> | 2015-02-05 11:44:02 +0200 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-02-19 00:28:34 -0500 |
commit | fe23bb85baa22dc06638c3ea8cbe5e6ee17bfa4a (patch) | |
tree | fc57c053d01a927cefc45629164aa3cc37e61471 /src | |
parent | 3af8db94cd315314ae8db096ba67f6655a005c23 (diff) |
glsl: Uniform linking support for doubles
Signed-off-by: Dave Airlie <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/link_uniforms.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index de2f6c9ac99..3aa6e0a9c74 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -608,7 +608,12 @@ private: } if (type->without_array()->is_matrix()) { - this->uniforms[id].matrix_stride = 16; + const glsl_type *matrix = type->without_array(); + const unsigned N = matrix->base_type == GLSL_TYPE_DOUBLE ? 8 : 4; + const unsigned items = row_major ? matrix->matrix_columns : matrix->vector_elements; + + assert(items <= 4); + this->uniforms[id].matrix_stride = glsl_align(items * N, 16); this->uniforms[id].row_major = row_major; } else { this->uniforms[id].matrix_stride = 0; |