MCPcopy Create free account
hub / github.com/GPUOpen-Tools/compressonator / SetChannelWeightsBC1

Function SetChannelWeightsBC1

cmp_core/shaders/bc1_encode_kernel.cpp:291–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291int CMP_CDECL SetChannelWeightsBC1(void* options, CGU_FLOAT WeightRed, CGU_FLOAT WeightGreen, CGU_FLOAT WeightBlue)
292{
293 if (!options)
294 return CGU_CORE_ERR_INVALIDPTR;
295 CMP_BC15Options* BC15optionsDefault = (CMP_BC15Options*)options;
296
297 if ((WeightRed < 0.0f) || (WeightRed > 1.0f))
298 return CGU_CORE_ERR_RANGERED;
299 if ((WeightGreen < 0.0f) || (WeightGreen > 1.0f))
300 return CGU_CORE_ERR_RANGEGREEN;
301 if ((WeightBlue < 0.0f) || (WeightBlue > 1.0f))
302 return CGU_CORE_ERR_RANGEBLUE;
303
304 BC15optionsDefault->m_bUseChannelWeighting = true;
305 BC15optionsDefault->m_fChannelWeights[0] = WeightRed;
306 BC15optionsDefault->m_fChannelWeights[1] = WeightGreen;
307 BC15optionsDefault->m_fChannelWeights[2] = WeightBlue;
308 return CGU_CORE_OK;
309}
310
311int CMP_CDECL SetSrgbBC1(void* options, CGU_BOOL sRGB)
312{

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68