Skip to content

Commit

Permalink
Replace half type with float type in NVIDIA Cg shaders.
Browse files Browse the repository at this point in the history
  • Loading branch information
christianaguilera-foundry committed Oct 11, 2023
1 parent 66b7b7d commit b2626d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/OpenColorIO/GpuShaderUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ std::string getFloatString(T v, GpuLanguage lang)
{
static_assert(!std::numeric_limits<T>::is_integer, "Only floating point values");

const T value = (lang == GPU_LANGUAGE_CG) ? (T)ClampToNormHalf(v) : v;
const T value = v;

T integerpart = (T)0;
const T fracpart = std::modf(value, &integerpart);
Expand Down Expand Up @@ -51,7 +51,7 @@ std::string getVecKeyword(GpuLanguage lang)
}
case GPU_LANGUAGE_CG:
{
kw << "half" << N;
kw << "float" << N;
break;
}

Expand Down Expand Up @@ -356,7 +356,7 @@ std::string GpuShaderText::constKeyword() const

std::string GpuShaderText::floatKeyword() const
{
return (m_lang == GPU_LANGUAGE_CG ? "half" : "float");
return "float";
}

std::string GpuShaderText::floatKeywordConst() const
Expand Down Expand Up @@ -904,7 +904,7 @@ std::string matrix4Mul(const T * m4x4, const std::string & vecName, GpuLanguage
}
case GPU_LANGUAGE_CG:
{
kw << "mul(half4x4("
kw << "mul(float4x4("
<< getMatrixValues<T, 4>(m4x4, lang, false) << "), " << vecName << ")";
break;
}
Expand Down

0 comments on commit b2626d0

Please sign in to comment.