summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-09-23 22:38:58 -0700
committerKenneth Graunke <[email protected]>2012-09-23 22:38:58 -0700
commitc432c86e6aeebeb46c028af940224c59faa16e88 (patch)
tree89d11ce804ac9946290bf32113d73d437c5d93a2 /src/mesa/main
parent60e610e0426d79fc9080df1a9ae0a6be39af1380 (diff)
mesa: Silence narrowing warnings in ff_fragment_shader's emit_texenv().
Recent version of GCC report a warning for the implicit conversion from int to float: ff_fragment_shader.cpp:897:3: warning: narrowing conversion of '(1 << ((int)rgb_shift))' from 'int' to 'float' inside { } is ill-formed in C++11 [-Wnarrowing] This is because floats cannot precisely represent all possible 32-bit integer values. However, texenv code is all expected to be floating point, so this should not be a problem. Signed-off-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/ff_fragment_shader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index e850d47dd80..f21cf80ae3d 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -890,10 +890,10 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit)
}
else {
float const_data[4] = {
- 1 << rgb_shift,
- 1 << rgb_shift,
- 1 << rgb_shift,
- 1 << alpha_shift
+ float(1 << rgb_shift),
+ float(1 << rgb_shift),
+ float(1 << rgb_shift),
+ float(1 << alpha_shift)
};
shift = new(p->mem_ctx) ir_constant(glsl_type::vec4_type,
(ir_constant_data *)const_data);