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

Method WriteBlockRGBA

cmp_compressonatorlib/buffer/codecbuffer.cpp:1949–2017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1947}
1948
1949bool CCodecBuffer::WriteBlockRGBA(CMP_DWORD x, CMP_DWORD y, CMP_BYTE w, CMP_BYTE h, CMP_SBYTE cBlock[])
1950{
1951#ifdef USE_DBGTRACE
1952 DbgTrace(());
1953#endif
1954 // Ok, so we don't support this format
1955 // So we try other formats to find one that is supported
1956
1957 if (m_bPerformingConversion)
1958 {
1959 return false;
1960 }
1961 else
1962 {
1963 m_bPerformingConversion = true;
1964
1965 CMP_DWORD dwBlock[MAX_BLOCK * 4];
1966 ConvertBlock(dwBlock, cBlock, w * h * 4);
1967 if (WriteBlockRGBA(x, y, w, h, dwBlock))
1968 {
1969 m_bPerformingConversion = false;
1970 return true;
1971 }
1972
1973 CMP_WORD wBlock[MAX_BLOCK * 4];
1974 ConvertBlock(wBlock, cBlock, w * h * 4);
1975 if (WriteBlockRGBA(x, y, w, h, wBlock))
1976 {
1977 m_bPerformingConversion = false;
1978 return true;
1979 }
1980
1981 CMP_BYTE bBlock[MAX_BLOCK * 4];
1982 ConvertBlock(bBlock, cBlock, w * h * 4);
1983 if (WriteBlockRGBA(x, y, w, h, bBlock))
1984 {
1985 m_bPerformingConversion = false;
1986 return true;
1987 }
1988
1989 double dBlock[MAX_BLOCK * 4];
1990 ConvertBlock(dBlock, cBlock, w * h * 4);
1991 if (WriteBlockRGBA(x, y, w, h, dBlock))
1992 {
1993 m_bPerformingConversion = false;
1994 return true;
1995 }
1996
1997 float fBlock[MAX_BLOCK * 4];
1998 ConvertBlock(fBlock, cBlock, w * h * 4);
1999 if (WriteBlockRGBA(x, y, w, h, fBlock))
2000 {
2001 m_bPerformingConversion = false;
2002 return true;
2003 }
2004
2005 CMP_HALF hBlock[MAX_BLOCK * 4];
2006 ConvertBlock(hBlock, cBlock, w * h * 4);

Callers 15

DecompressMethod · 0.45
DecompressMethod · 0.45
DecompressMethod · 0.45
DecompressMethod · 0.45
DecompressMethod · 0.45
DecompressMethod · 0.45
DecompressMethod · 0.45
DecompressMethod · 0.45
DecompressMethod · 0.45
WriteBlockMethod · 0.45
WriteBlockMethod · 0.45
DecompressMethod · 0.45

Calls

no outgoing calls

Tested by 1

RunRGBATestFunction · 0.36