summaryrefslogtreecommitdiff
path: root/thirdparty
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-01 16:47:07 +0200
committerGitHub <noreply@github.com>2020-04-01 16:47:07 +0200
commit84b308f4468d964fd126dfc9f8e98dad557ba982 (patch)
tree27108fccbea55cab0f7566aaf508e00fc783ddbe /thirdparty
parente53cbba36cf6cbf4f42621a0650ca8e57989379e (diff)
parentdbf52c63cc7894acdba9b032566376171ef270a7 (diff)
Merge pull request #37488 from akien-mga/etc2comp-rgba8-max-channels
etc2comp: Fix max iterations for RGBA channels
Diffstat (limited to 'thirdparty')
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp24
-rw-r--r--thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp24
-rw-r--r--thirdparty/etc2comp/patches/fix-rgba8-max-channels.patch224
3 files changed, 248 insertions, 24 deletions
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
index 5656556db9..5c7ebed788 100644
--- a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
@@ -508,7 +508,7 @@ namespace Etc
int iMaxRed1 = iColor1Red + (int)a_uiRadius;
if (iMaxRed1 > 15)
{
- iMinRed1 = 15;
+ iMaxRed1 = 15;
}
int iMinGreen1 = iColor1Green - (int)a_uiRadius;
@@ -519,7 +519,7 @@ namespace Etc
int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
if (iMaxGreen1 > 15)
{
- iMinGreen1 = 15;
+ iMaxGreen1 = 15;
}
int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
@@ -530,7 +530,7 @@ namespace Etc
int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
if (iMaxBlue1 > 15)
{
- iMinBlue1 = 15;
+ iMaxBlue1 = 15;
}
int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
@@ -545,7 +545,7 @@ namespace Etc
int iMaxRed2 = iColor2Red + (int)a_uiRadius;
if (iMaxRed2 > 15)
{
- iMinRed2 = 15;
+ iMaxRed2 = 15;
}
int iMinGreen2 = iColor2Green - (int)a_uiRadius;
@@ -556,7 +556,7 @@ namespace Etc
int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
if (iMaxGreen2 > 15)
{
- iMinGreen2 = 15;
+ iMaxGreen2 = 15;
}
int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
@@ -567,7 +567,7 @@ namespace Etc
int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
if (iMaxBlue2 > 15)
{
- iMinBlue2 = 15;
+ iMaxBlue2 = 15;
}
for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
@@ -761,7 +761,7 @@ namespace Etc
int iMaxRed1 = iColor1Red + (int)a_uiRadius;
if (iMaxRed1 > 15)
{
- iMinRed1 = 15;
+ iMaxRed1 = 15;
}
int iMinGreen1 = iColor1Green - (int)a_uiRadius;
@@ -772,7 +772,7 @@ namespace Etc
int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
if (iMaxGreen1 > 15)
{
- iMinGreen1 = 15;
+ iMaxGreen1 = 15;
}
int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
@@ -783,7 +783,7 @@ namespace Etc
int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
if (iMaxBlue1 > 15)
{
- iMinBlue1 = 15;
+ iMaxBlue1 = 15;
}
int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
@@ -798,7 +798,7 @@ namespace Etc
int iMaxRed2 = iColor2Red + (int)a_uiRadius;
if (iMaxRed2 > 15)
{
- iMinRed2 = 15;
+ iMaxRed2 = 15;
}
int iMinGreen2 = iColor2Green - (int)a_uiRadius;
@@ -809,7 +809,7 @@ namespace Etc
int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
if (iMaxGreen2 > 15)
{
- iMinGreen2 = 15;
+ iMaxGreen2 = 15;
}
int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
@@ -820,7 +820,7 @@ namespace Etc
int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
if (iMaxBlue2 > 15)
{
- iMinBlue2 = 15;
+ iMaxBlue2 = 15;
}
for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
index ba2b42fb05..b94b64e68c 100644
--- a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
+++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
@@ -847,7 +847,7 @@ namespace Etc
int iMaxRed1 = iColor1Red + (int)a_uiRadius;
if (iMaxRed1 > 15)
{
- iMinRed1 = 15;
+ iMaxRed1 = 15;
}
int iMinGreen1 = iColor1Green - (int)a_uiRadius;
@@ -858,7 +858,7 @@ namespace Etc
int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
if (iMaxGreen1 > 15)
{
- iMinGreen1 = 15;
+ iMaxGreen1 = 15;
}
int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
@@ -869,7 +869,7 @@ namespace Etc
int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
if (iMaxBlue1 > 15)
{
- iMinBlue1 = 15;
+ iMaxBlue1 = 15;
}
int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
@@ -884,7 +884,7 @@ namespace Etc
int iMaxRed2 = iColor2Red + (int)a_uiRadius;
if (iMaxRed2 > 15)
{
- iMinRed2 = 15;
+ iMaxRed2 = 15;
}
int iMinGreen2 = iColor2Green - (int)a_uiRadius;
@@ -895,7 +895,7 @@ namespace Etc
int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
if (iMaxGreen2 > 15)
{
- iMinGreen2 = 15;
+ iMaxGreen2 = 15;
}
int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
@@ -906,7 +906,7 @@ namespace Etc
int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
if (iMaxBlue2 > 15)
{
- iMinBlue2 = 15;
+ iMaxBlue2 = 15;
}
for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
@@ -1108,7 +1108,7 @@ namespace Etc
int iMaxRed1 = iColor1Red + (int)a_uiRadius;
if (iMaxRed1 > 15)
{
- iMinRed1 = 15;
+ iMaxRed1 = 15;
}
int iMinGreen1 = iColor1Green - (int)a_uiRadius;
@@ -1119,7 +1119,7 @@ namespace Etc
int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
if (iMaxGreen1 > 15)
{
- iMinGreen1 = 15;
+ iMaxGreen1 = 15;
}
int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
@@ -1130,7 +1130,7 @@ namespace Etc
int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
if (iMaxBlue1 > 15)
{
- iMinBlue1 = 15;
+ iMaxBlue1 = 15;
}
int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
@@ -1145,7 +1145,7 @@ namespace Etc
int iMaxRed2 = iColor2Red + (int)a_uiRadius;
if (iMaxRed2 > 15)
{
- iMinRed2 = 15;
+ iMaxRed2 = 15;
}
int iMinGreen2 = iColor2Green - (int)a_uiRadius;
@@ -1156,7 +1156,7 @@ namespace Etc
int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
if (iMaxGreen2 > 15)
{
- iMinGreen2 = 15;
+ iMaxGreen2 = 15;
}
int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
@@ -1167,7 +1167,7 @@ namespace Etc
int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
if (iMaxBlue2 > 15)
{
- iMinBlue2 = 15;
+ iMaxBlue2 = 15;
}
for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
diff --git a/thirdparty/etc2comp/patches/fix-rgba8-max-channels.patch b/thirdparty/etc2comp/patches/fix-rgba8-max-channels.patch
new file mode 100644
index 0000000000..ea9b5640b6
--- /dev/null
+++ b/thirdparty/etc2comp/patches/fix-rgba8-max-channels.patch
@@ -0,0 +1,224 @@
+diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
+index 5656556db9..5c7ebed788 100644
+--- a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
++++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
+@@ -508,7 +508,7 @@ namespace Etc
+ int iMaxRed1 = iColor1Red + (int)a_uiRadius;
+ if (iMaxRed1 > 15)
+ {
+- iMinRed1 = 15;
++ iMaxRed1 = 15;
+ }
+
+ int iMinGreen1 = iColor1Green - (int)a_uiRadius;
+@@ -519,7 +519,7 @@ namespace Etc
+ int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
+ if (iMaxGreen1 > 15)
+ {
+- iMinGreen1 = 15;
++ iMaxGreen1 = 15;
+ }
+
+ int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
+@@ -530,7 +530,7 @@ namespace Etc
+ int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
+ if (iMaxBlue1 > 15)
+ {
+- iMinBlue1 = 15;
++ iMaxBlue1 = 15;
+ }
+
+ int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
+@@ -545,7 +545,7 @@ namespace Etc
+ int iMaxRed2 = iColor2Red + (int)a_uiRadius;
+ if (iMaxRed2 > 15)
+ {
+- iMinRed2 = 15;
++ iMaxRed2 = 15;
+ }
+
+ int iMinGreen2 = iColor2Green - (int)a_uiRadius;
+@@ -556,7 +556,7 @@ namespace Etc
+ int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
+ if (iMaxGreen2 > 15)
+ {
+- iMinGreen2 = 15;
++ iMaxGreen2 = 15;
+ }
+
+ int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
+@@ -567,7 +567,7 @@ namespace Etc
+ int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
+ if (iMaxBlue2 > 15)
+ {
+- iMinBlue2 = 15;
++ iMaxBlue2 = 15;
+ }
+
+ for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
+@@ -761,7 +761,7 @@ namespace Etc
+ int iMaxRed1 = iColor1Red + (int)a_uiRadius;
+ if (iMaxRed1 > 15)
+ {
+- iMinRed1 = 15;
++ iMaxRed1 = 15;
+ }
+
+ int iMinGreen1 = iColor1Green - (int)a_uiRadius;
+@@ -772,7 +772,7 @@ namespace Etc
+ int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
+ if (iMaxGreen1 > 15)
+ {
+- iMinGreen1 = 15;
++ iMaxGreen1 = 15;
+ }
+
+ int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
+@@ -783,7 +783,7 @@ namespace Etc
+ int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
+ if (iMaxBlue1 > 15)
+ {
+- iMinBlue1 = 15;
++ iMaxBlue1 = 15;
+ }
+
+ int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
+@@ -798,7 +798,7 @@ namespace Etc
+ int iMaxRed2 = iColor2Red + (int)a_uiRadius;
+ if (iMaxRed2 > 15)
+ {
+- iMinRed2 = 15;
++ iMaxRed2 = 15;
+ }
+
+ int iMinGreen2 = iColor2Green - (int)a_uiRadius;
+@@ -809,7 +809,7 @@ namespace Etc
+ int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
+ if (iMaxGreen2 > 15)
+ {
+- iMinGreen2 = 15;
++ iMaxGreen2 = 15;
+ }
+
+ int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
+@@ -820,7 +820,7 @@ namespace Etc
+ int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
+ if (iMaxBlue2 > 15)
+ {
+- iMinBlue2 = 15;
++ iMaxBlue2 = 15;
+ }
+
+ for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
+diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
+index ba2b42fb05..b94b64e68c 100644
+--- a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
++++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
+@@ -847,7 +847,7 @@ namespace Etc
+ int iMaxRed1 = iColor1Red + (int)a_uiRadius;
+ if (iMaxRed1 > 15)
+ {
+- iMinRed1 = 15;
++ iMaxRed1 = 15;
+ }
+
+ int iMinGreen1 = iColor1Green - (int)a_uiRadius;
+@@ -858,7 +858,7 @@ namespace Etc
+ int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
+ if (iMaxGreen1 > 15)
+ {
+- iMinGreen1 = 15;
++ iMaxGreen1 = 15;
+ }
+
+ int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
+@@ -869,7 +869,7 @@ namespace Etc
+ int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
+ if (iMaxBlue1 > 15)
+ {
+- iMinBlue1 = 15;
++ iMaxBlue1 = 15;
+ }
+
+ int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
+@@ -884,7 +884,7 @@ namespace Etc
+ int iMaxRed2 = iColor2Red + (int)a_uiRadius;
+ if (iMaxRed2 > 15)
+ {
+- iMinRed2 = 15;
++ iMaxRed2 = 15;
+ }
+
+ int iMinGreen2 = iColor2Green - (int)a_uiRadius;
+@@ -895,7 +895,7 @@ namespace Etc
+ int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
+ if (iMaxGreen2 > 15)
+ {
+- iMinGreen2 = 15;
++ iMaxGreen2 = 15;
+ }
+
+ int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
+@@ -906,7 +906,7 @@ namespace Etc
+ int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
+ if (iMaxBlue2 > 15)
+ {
+- iMinBlue2 = 15;
++ iMaxBlue2 = 15;
+ }
+
+ for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
+@@ -1108,7 +1108,7 @@ namespace Etc
+ int iMaxRed1 = iColor1Red + (int)a_uiRadius;
+ if (iMaxRed1 > 15)
+ {
+- iMinRed1 = 15;
++ iMaxRed1 = 15;
+ }
+
+ int iMinGreen1 = iColor1Green - (int)a_uiRadius;
+@@ -1119,7 +1119,7 @@ namespace Etc
+ int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
+ if (iMaxGreen1 > 15)
+ {
+- iMinGreen1 = 15;
++ iMaxGreen1 = 15;
+ }
+
+ int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
+@@ -1130,7 +1130,7 @@ namespace Etc
+ int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
+ if (iMaxBlue1 > 15)
+ {
+- iMinBlue1 = 15;
++ iMaxBlue1 = 15;
+ }
+
+ int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
+@@ -1145,7 +1145,7 @@ namespace Etc
+ int iMaxRed2 = iColor2Red + (int)a_uiRadius;
+ if (iMaxRed2 > 15)
+ {
+- iMinRed2 = 15;
++ iMaxRed2 = 15;
+ }
+
+ int iMinGreen2 = iColor2Green - (int)a_uiRadius;
+@@ -1156,7 +1156,7 @@ namespace Etc
+ int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
+ if (iMaxGreen2 > 15)
+ {
+- iMinGreen2 = 15;
++ iMaxGreen2 = 15;
+ }
+
+ int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
+@@ -1167,7 +1167,7 @@ namespace Etc
+ int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
+ if (iMaxBlue2 > 15)
+ {
+- iMinBlue2 = 15;
++ iMaxBlue2 = 15;
+ }
+
+ for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)