mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 12:40:09 +01:00
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 <kenneth@whitecape.org>
This commit is contained in:
parent
60e610e042
commit
c432c86e6a
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue