Skip to content

Commit

Permalink
Merge pull request KhronosGroup#475 from KhronosGroup/fix-convert-cast
Browse files Browse the repository at this point in the history
Fix implicit conversion bug.
  • Loading branch information
HansKristian-Work authored Feb 26, 2018
2 parents b39c063 + e69b1ae commit cae1722
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spirv_glsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,7 @@ string CompilerGLSL::convert_float_to_string(const SPIRConstant &c, uint32_t col
string res;
float float_value = c.scalar_f32(col, row);

if (isnan(float_value) || isinf(float_value))
if (std::isnan(float_value) || std::isinf(float_value))
{
// Use special representation.
if (!is_legacy())
Expand Down Expand Up @@ -2578,7 +2578,7 @@ string CompilerGLSL::convert_float_to_string(const SPIRConstant &c, uint32_t col
else
res = "(-1.0 / 0.0)";
}
else if (isnan(float_value))
else if (std::isnan(float_value))
{
if (backend.float_literal_suffix)
res = "(0.0f / 0.0f)";
Expand All @@ -2602,9 +2602,9 @@ string CompilerGLSL::convert_float_to_string(const SPIRConstant &c, uint32_t col
std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32_t col, uint32_t row)
{
string res;
float double_value = c.scalar_f64(col, row);
double double_value = c.scalar_f64(col, row);

if (isnan(double_value) || isinf(double_value))
if (std::isnan(double_value) || std::isinf(double_value))
{
// Use special representation.
if (!is_legacy())
Expand Down Expand Up @@ -2650,7 +2650,7 @@ std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32
else
res = "(-1.0 / 0.0)";
}
else if (isnan(double_value))
else if (std::isnan(double_value))
{
if (backend.double_literal_suffix)
res = "(0.0lf / 0.0lf)";
Expand Down

0 comments on commit cae1722

Please sign in to comment.