Mesa (master): glsl: Mark float constants as such

Iago Toral Quiroga itoral at kemper.freedesktop.org
Fri Feb 19 13:18:31 UTC 2016


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

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Fri Feb 19 09:18:41 2016 +0100

glsl: Mark float constants as such

So we don't generate double to float conversion code

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

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

diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
index 238993e..2ed61de 100644
--- a/src/compiler/glsl/ast_function.cpp
+++ b/src/compiler/glsl/ast_function.cpp
@@ -1484,12 +1484,12 @@ emit_inline_matrix_constructor(const glsl_type *type,
          for (/* empty */; col < var->type->matrix_columns; col++) {
             ir_constant_data ident;
 
-            ident.f[0] = 0.0;
-            ident.f[1] = 0.0;
-            ident.f[2] = 0.0;
-            ident.f[3] = 0.0;
+            ident.f[0] = 0.0f;
+            ident.f[1] = 0.0f;
+            ident.f[2] = 0.0f;
+            ident.f[3] = 0.0f;
 
-            ident.f[col] = 1.0;
+            ident.f[col] = 1.0f;
 
             ir_rvalue *const rhs = new(ctx) ir_constant(col_type, &ident);
 




More information about the mesa-commit mailing list