MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / float3GreaterThan

Method float3GreaterThan

src/OpenColorIO/GpuShaderUtils.cpp:1147–1181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1145}
1146
1147std::string GpuShaderText::float3GreaterThan(const std::string & a,
1148 const std::string & b) const
1149{
1150 std::ostringstream kw;
1151 switch (m_lang)
1152 {
1153 case GPU_LANGUAGE_GLSL_1_2:
1154 case GPU_LANGUAGE_GLSL_1_3:
1155 case GPU_LANGUAGE_GLSL_4_0:
1156 case GPU_LANGUAGE_GLSL_VK_4_6:
1157 case GPU_LANGUAGE_GLSL_ES_1_0:
1158 case GPU_LANGUAGE_GLSL_ES_3_0:
1159 case GPU_LANGUAGE_CG:
1160 {
1161 kw << float3Keyword() << "(greaterThan( " << a << ", " << b << "))";
1162 break;
1163 }
1164 case LANGUAGE_OSL_1:
1165 case GPU_LANGUAGE_MSL_2_0:
1166 case GPU_LANGUAGE_HLSL_SM_5_0:
1167 {
1168 kw << float3Keyword() << "("
1169 << "(" << a << "[0] > " << b << "[0]) ? 1.0 : 0.0, "
1170 << "(" << a << "[1] > " << b << "[1]) ? 1.0 : 0.0, "
1171 << "(" << a << "[2] > " << b << "[2]) ? 1.0 : 0.0)";
1172 break;
1173 }
1174
1175 default:
1176 {
1177 throw Exception("Unknown GPU shader language.");
1178 }
1179 }
1180 return kw.str();
1181}
1182
1183std::string GpuShaderText::float4GreaterThan(const std::string & a,
1184 const std::string & b) const

Callers 4

AddCameraLogToLinShaderFunction · 0.80
AddCameraLinToLogShaderFunction · 0.80
Add_LIN_TO_GAMMA_LOGFunction · 0.80
Add_GAMMA_LOG_TO_LINFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected