Mesa (master): compiler: use 64bit check for sizing instead of double check.

Dave Airlie airlied at kemper.freedesktop.org
Wed Jun 8 21:44:14 UTC 2016


Module: Mesa
Branch: master
Commit: a82b8e8b36cdaf8fd95a38b8df4215bead0e3ae7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a82b8e8b36cdaf8fd95a38b8df4215bead0e3ae7

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Jun  9 07:07:06 2016 +1000

compiler: use 64bit check for sizing instead of double check.

This just moves code to the new check in advance of int64 support.

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/compiler/glsl_types.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 11f1e85..884f311 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -1434,7 +1434,7 @@ glsl_type::can_implicitly_convert_to(const glsl_type *desired,
 unsigned
 glsl_type::std140_base_alignment(bool row_major) const
 {
-   unsigned N = is_double() ? 8 : 4;
+   unsigned N = is_64bit() ? 8 : 4;
 
    /* (1) If the member is a scalar consuming <N> basic machine units, the
     *     base alignment is <N>.
@@ -1552,7 +1552,7 @@ glsl_type::std140_base_alignment(bool row_major) const
 unsigned
 glsl_type::std140_size(bool row_major) const
 {
-   unsigned N = is_double() ? 8 : 4;
+   unsigned N = is_64bit() ? 8 : 4;
 
    /* (1) If the member is a scalar consuming <N> basic machine units, the
     *     base alignment is <N>.
@@ -1689,7 +1689,7 @@ unsigned
 glsl_type::std430_base_alignment(bool row_major) const
 {
 
-   unsigned N = is_double() ? 8 : 4;
+   unsigned N = is_64bit() ? 8 : 4;
 
    /* (1) If the member is a scalar consuming <N> basic machine units, the
     *     base alignment is <N>.
@@ -1798,7 +1798,7 @@ glsl_type::std430_base_alignment(bool row_major) const
 unsigned
 glsl_type::std430_array_stride(bool row_major) const
 {
-   unsigned N = is_double() ? 8 : 4;
+   unsigned N = is_64bit() ? 8 : 4;
 
    /* Notice that the array stride of a vec3 is not 3 * N but 4 * N.
     * See OpenGL 4.30 spec, section 7.6.2.2 "Standard Uniform Block Layout"
@@ -1816,7 +1816,7 @@ glsl_type::std430_array_stride(bool row_major) const
 unsigned
 glsl_type::std430_size(bool row_major) const
 {
-   unsigned N = is_double() ? 8 : 4;
+   unsigned N = is_64bit() ? 8 : 4;
 
    /* OpenGL 4.30 spec, section 7.6.2.2 "Standard Uniform Block Layout":
     *




More information about the mesa-commit mailing list