summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2015-03-01 19:35:19 +0000
committerMatt Turner <mattst88@gentoo.org>2015-03-01 19:35:19 +0000
commit2110cb95514d299dfabfcf291b385ab264c57f2d (patch)
tree8f7ff766b6ec5073032106a5456e08350bd365ac /media-libs/mesa
parentDrop r600-llvm-compiler USE flag. Upstream only wants active developers to us... (diff)
downloadhistorical-2110cb95514d299dfabfcf291b385ab264c57f2d.tar.gz
historical-2110cb95514d299dfabfcf291b385ab264c57f2d.tar.bz2
historical-2110cb95514d299dfabfcf291b385ab264c57f2d.zip
Add patch to reduce compile time/memory, bug 540960.
Package-Manager: portage-2.2.17/cvs/Linux x86_64 Manifest-Sign-Key: 0x974CA72A
Diffstat (limited to 'media-libs/mesa')
-rw-r--r--media-libs/mesa/ChangeLog7
-rw-r--r--media-libs/mesa/Manifest33
-rw-r--r--media-libs/mesa/files/mesa-10.3.7-format_utils.c.patch1089
-rw-r--r--media-libs/mesa/mesa-10.3.7-r1.ebuild3
-rw-r--r--media-libs/mesa/mesa-10.3.7-r2.ebuild3
5 files changed, 1116 insertions, 19 deletions
diff --git a/media-libs/mesa/ChangeLog b/media-libs/mesa/ChangeLog
index 84bbf47b5797..bb5d8c10c7fe 100644
--- a/media-libs/mesa/ChangeLog
+++ b/media-libs/mesa/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for media-libs/mesa
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.621 2015/03/01 19:29:20 mattst88 Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.622 2015/03/01 19:35:16 mattst88 Exp $
+
+ 01 Mar 2015; Matt Turner <mattst88@gentoo.org>
+ +files/mesa-10.3.7-format_utils.c.patch, mesa-10.3.7-r1.ebuild,
+ mesa-10.3.7-r2.ebuild:
+ Add patch to reduce compile time/memory, bug 540960.
01 Mar 2015; Matt Turner <mattst88@gentoo.org> mesa-10.5.0_rc3.ebuild:
Drop r600-llvm-compiler USE flag. Upstream only wants active developers to use
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 4d25216b0ad9..0157a1e5a64e 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -10,6 +10,7 @@ AUX glx_ro_text_segm.patch 731 SHA256 e36af5b530fdbe2b0e62a035bf4bf4baef267c3dc5
AUX mesa-10.2-dont-require-llvm-for-r300.patch 547 SHA256 83cfeae33b1e8c84b37ed59c353000eb775978ae3d9035ba8ce4f63a167756fc SHA512 d1cb5a989aa001c99f353d27ab5b28ac05d60050614bbfd76ca5d312e00efcc2b1a2459d30d697b68119310c69512b4195afce6c0ed7f31fb9cf14689a740e27 WHIRLPOOL c06669942d275a9d9f132ec8f51d3ecf23d33cb89cb607ba3a7861f209f283b39a9568513b07e22f0dfcc99339a307d7b2a6b03f261ed583fd4518d3b4d0b464
AUX mesa-10.2-sysfs-instead-of-libudev.patch 9568 SHA256 e0b7fea7bbf4883dae58c816f1b680f0f1396e83c9717c8b22805c1616214af2 SHA512 6302fdd0c94c1ddca4bd73d05ee6e12664a78978efbd7233d0d4c0d9706c23b716d78e5a31eef87c0606fdf65f49be8f21f8adbeb086660a0053c600bf5ee2d3 WHIRLPOOL 982b2d722f281ce2e5b20f835a53d93d1cad500668fc367e45c10293bfb5e045f8ea5679229edf5f84b3fcc2d07c650159191e3514d444c1d832048522b35041
AUX mesa-10.3.7-dont-use-clrsb.patch 1140 SHA256 23626c6bf1e502f17f4b9236b512063b41bf52be64f56252f0fc5ce456824d58 SHA512 2d9dd9a56c3bab02e8ec1a1ab4d88c2855746d8243548f197cb43de6e980554447c75e53c07dcd270de7e1c282cf7fdf996e5102a24e47b75e484a18f99092e0 WHIRLPOOL 47b222fb61427bbe2a63ac4b738608e9c3491e6373c33e1d68c79198a111d7668b4cafbac9e58820e8cefae55dffca46ab57dbe91ad819feeb734c32f01020f0
+AUX mesa-10.3.7-format_utils.c.patch 34839 SHA256 81ec8d547d798aa5ef5dfc9f0685291af04f95882608f8e9db39a867f44ab431 SHA512 777597b41c37ced0fb375048cc30c4cac701c6020c70bd0f6fbbc2d6f2c1ac9ece0f6d411d81dd042be7f2fbc17e0536176d8230b93f9eed7d7ddf205ac98bb8 WHIRLPOOL 51a213c415d81250a2bc3ad117581b62c4eed13152a9550b2214a9c63f85a6559b1504e013ae0d8e56d5adcaff053c753aa833d7acbe10185d468fdfed5e1b72
AUX mesa-8.0-dont-require-llvm-for-r300.patch 916 SHA256 560f224a12b47fb86bd2ecbe7dc32c79e2be9a26321a79921f83527656ed553a SHA512 ce637b9210517375ae2c77981e0882d161e2027801356b80ec31d50157e52eecdb2ca3b9dc3787c789b39005fcd4cf73290e0879bd5e25638d33ef2cd5e443b8 WHIRLPOOL a14401c13deb209f0ce2e72c360a33ece1d87bd62be79ca8fcef46db29d75f0f4e60b5ef0527bf0bf6196d99a6d2f11da332537beb8c7627b1d7e810a3cfb2e8
AUX mesa-8.0.4-configure-bsd.patch 482 SHA256 5e217191f37a49b56d0404605b51a88f0a3ee0a271a74fd8d25e7b6685e57017 SHA512 efc924315b461c310e632068ec31520048e9d22fe6c35fa47e2c650e778114c6757ff9e4095094d6fa0bb4f82f45217ed9f5320a58de1a2559776a159b722631 WHIRLPOOL 46353a6eb942037d20e07007f7dbe68350d3131d58d4065db133b5655fe9cc88142b6d3c7797602d764d40f622830bf578c559f8868965b240a4bf911bafa034
AUX mesa-8.1-dont-require-llvm-for-r300.patch 861 SHA256 7ca0a7135834448ea7ca27903a40bf3b0a39325613f8a66a718407aa28504fbf SHA512 a2e7ed3b9b51c3a9a98d83c8fdeb8b777a4877fac25e969b01ff92d6971c10dda9f64e6310c739597ad7ba04106c72925ee5931417f2b8d764f9bd799efd2142 WHIRLPOOL a82863366507835ec0a6562f70389e0d050fd23ea25e7c113ef4a0e1298a1543afa8c1fa51c90ece83f41ac6f3bda6083fd50b8f1292b863cd320186fba8f732
@@ -36,8 +37,8 @@ EBUILD mesa-10.0.4.ebuild 13888 SHA256 85ee7d46ef6302f0ad2fedc604d2928121f955274
EBUILD mesa-10.1.6.ebuild 14210 SHA256 197ef375a865ffb71b09daea02a57d422f297aeb9b7c07208e4b3ac332485fa5 SHA512 288b2da00e10350134806da7902374a6815ce15a488c351528f6ebee1a592b3680c1d04e73ce5527a4ef5e730daf03c54e795874da1c160bd2fd2fdf286f882d WHIRLPOOL 3884494bc4cf64fc1e19a5352c345ef968e6d8b041d5752935f48b738a52cc0c0772fd53495edd999e844a46b15c7c08619c4583a2a35a467bd8f2b788ce2c42
EBUILD mesa-10.2.8.ebuild 14971 SHA256 13c738620bdd571e152bc45ccf2773aebb95e86868182234f0eaacaf3b3750c4 SHA512 2223c328dd2d06c8735a8e72c2406b6a997d8ccce847f6c0494bf7f553ef39bf73f2fbb3359eabb09bf48f14e695b80e936032743efc761a3dd3e1f73803f49a WHIRLPOOL 3f384e50478c31adad7ea9cc0dc98fe433ba10aff0686ce775e6e87a752e270a825176753dc97d4b699a92747f600c55cda4a34560bd54f5bd55b93d9982a36e
EBUILD mesa-10.3.5.ebuild 14933 SHA256 c755e4d4971013020b2798ec488186cb5297626b350efacea7ac3c93160e7797 SHA512 a26b153251259fdc5cc1fce4478fd504b7ae9208e2776d10a15ff0cf801af54ec26343a08897be9e5c26d3a4f78ac73111c1d2f5838ab01eb26fe1563a8f28dc WHIRLPOOL b571b41918aef53b3f131d7d09e709d41ce68f4714a15693a6ef41a52b110639d5d103df05f839fcdcdc019eb67c1eb5de865c9502de11633450081219346fa4
-EBUILD mesa-10.3.7-r1.ebuild 14986 SHA256 e6c77b667da8f448b627e30734e1eaf6edb7f57972bb76ba575e25727d0af26b SHA512 53ef4dd59b6c6d314321efdf2c38cab39fea5a683b9a66819c18ddf8c93fab88a27b9f6f834df440a17c48534af6aae6323654df99be6a8dce6c0897d4fb8aab WHIRLPOOL c6e934d59f19d6a417e9e8938e870e1992a44e8c06ad1627deee0096c69b03afb14141c7abe293451a6aec8be0b843bad8847fa77ef547dd9388959555d52db5
-EBUILD mesa-10.3.7-r2.ebuild 13867 SHA256 b6c0f1790f695a2b64395a4b9a79df224c04ea600dc23adad47590d5cadad638 SHA512 2aae25397edddc2ab1f716d7f853f549c3a4dc4464c4931ced7ab1e4aa8999982c40d1ecb969536f543f1e8dc79c09b369313e029482e9871c9629d2beb527b1 WHIRLPOOL 76130a4357fb6e3f6cf2ff66579b873d4a2f1effb58faf688c6e7404eb6e7defeedc897f7f7ae59934346f9ebe5374da7899d2cf38d09886c122e75114df2c56
+EBUILD mesa-10.3.7-r1.ebuild 15043 SHA256 ed88e81b942b37b2ea77b81e8800b2fcef9b842dcee53f003a5a578d28dd9bcf SHA512 9f9f71a2da2751e8a63df2995a5dcc2736248b9ed03494fba16c481ba3410c5b0091472b6bd697d1675e3bf491321285989c718c0d4161fc889023aa3390f90d WHIRLPOOL d76f0525697b5a34cf92a4d3b3197d2ecb3b412c9f246aa04b5d43296066bfaca0b878f08f234c1d8ec51a7c93423492f6031831c51f3ffdcffb989242872a88
+EBUILD mesa-10.3.7-r2.ebuild 13923 SHA256 5824043f36c6c6bfad999ea43c3ee235dc994099f34838f259b8dbfcd6927e6c SHA512 7108ff2703940e73ccaa0a4dbddb926af671a6554e508a0c5674f1eb3a675ba8026a0816e8272e48c789fcba9bc069a7c0f2321b272edd02cbe58c85924a0a4c WHIRLPOOL d0bdfd3400c9145e4cc2ce51ff4453b980b4e501d5c0c91e45ee58506a66d57597879070ce8bbaa9d8e2decce0004014b7b09da558d8b101069dd7e8bc786f15
EBUILD mesa-10.4.3.ebuild 13840 SHA256 51736954b467dd112973539c2e492454384b34bdc954da0a6e91a5a8fed42b61 SHA512 e7485a93adb4a7c15e6c42c8c20fe074883eeab51f6faf63d6068884cce7fa04e57d1eb76e51c12ec497ae542aa6434f86ae85a17506fa8186d73ecb970bdafe WHIRLPOOL 5b1f00e7694118303f4b9a5a432d7f4ee42bc37321b7f2749a5ac977f173fac5906b01770d2df071b3fa1042e1f9bff2c691ccc05799687e0f952b0100d7d1e4
EBUILD mesa-10.4.4.ebuild 13841 SHA256 bf93ac6975da85d3d6cff6253a5ba10cfa87592af89141016fda8d5ca80bb31e SHA512 5fc5e34beffab6c3107aadbaf510e541d2d9727cb7039977ab6fe3c95d898808ec68222e7d2f4b099eaaa350675c11b91e4a5f82c8950a36fa6a1c94f9dfceea WHIRLPOOL 346790de8c1a187c6e904124e4b7e07162fd8ff5efc518bceaa88ba3b6eb71d8d7a22b319c0021cc2ce2e12c267b7f50bab1b7e414727633fa047246fdbd310a
EBUILD mesa-10.5.0_rc3.ebuild 12608 SHA256 554406ae2ecc49d4671985bf1d06f6b55110f3bbbe63132601f8882ffe962205 SHA512 5d8d6dbe1824b9f44fe949811cdc22cbe52b5c5f0203a256c09f45da7b2c5d2f847c44a2af451ef9992a76a08abfb9ab6415f305f6a6acc4488628feb01ce6e4 WHIRLPOOL b5417d161917b7aceba8804d92f2a3f132297c5845ce664b8a4e5ba2d6a5ed8ac4bbdd6c7371de4d5017108a18103b5a120c673691374f8fa1e29b2dc1f1df88
@@ -47,22 +48,22 @@ EBUILD mesa-8.0.4-r1.ebuild 10823 SHA256 761568a982c1bc3f0ef9bc02d8cac3f4715a7b4
EBUILD mesa-9.0.3.ebuild 11145 SHA256 379a630b8fed1b34d257a935f7bac35b695e4b66b6be0cdc8960f374d8bff834 SHA512 55a765bfdc4ff99f29681d75d55298795000d35390adb7ab1a8a8c7c376ee5fcf31992ffd5e9339e1dd1f228788f3f147a31dddc141f658e4eea334ce41ee386 WHIRLPOOL 624501d0d91dc5f9a46ae974edd325fd61b642e8c31564538bd69b4bd63eccb0409f129336d6cd116acd67586dc2262ee401072699b9f498add64973c5c44f0c
EBUILD mesa-9.1.6.ebuild 11075 SHA256 eb99e3b72fc2398fd9719caf780f9e3738db295572964f168102eeb6542f6c8a SHA512 2a406cd612f5ffc905adb76dbcf153e4bc61f010f9192949760aaa6809d4bbf05a533c23c823df3bb1b1b07ab3e1e6f4ee2ea14c2231a4c93973bd40c5411879 WHIRLPOOL 64c34ae571a1dd28a877e8be2bb2adcbd864d94bd53ae9769bcf61ac9716401de678bdcdd42e20b716e8611604b394eb1e7967925815458373ed505b6565eac5
EBUILD mesa-9.2.5-r1.ebuild 13966 SHA256 224dffb84e94cfef85977df598fae25c3d156f2914cf6f9e9d56c60d033d00de SHA512 63f08a5427fe4f475f643bf58f2f4b320b3f393b32ea7e8e4b25677d4774f0f5055135c459b779205ae68ec079544ac9c9131e1a2bad8f149d6c481aa84b7cbe WHIRLPOOL 6d8b0f4563a603a6d029ac5a5acbcc38456b82dea281101d62f2c25bce65db374bf9ab6b374f67f3efad7ca54b126f16294d8ae42e7cea2f902f4ae17da5323b
-MISC ChangeLog 99350 SHA256 15e77c7c2b96b7eea163e28d7158413c0a4a4a4ee3a3433a70ad0014dbc8c199 SHA512 a0d56f3dddaa005f7b64bb495e16e887d0f410133317a79cac72e3ba82d5e2f26e23b332c33e61482991942b75d524b8792001a847c817873f585831f1ebcc0e WHIRLPOOL 4a23696395be80c1fb7f6e349e87486da1879c8c9d0652809ea41b5e956da5b614dfc96cc081d3db125d5cc286666f3f7b8e0e8c4b55f0681ed8e766559bc3a9
+MISC ChangeLog 99546 SHA256 c61c311fc918da93a081b764cffe8337b50efee81ae81639c8416eb2c760adcf SHA512 9d4259cf6e3c70012d2c15a7abde99ac44d7beb7839403127c885167f7140d4f0f8955942b7c67d23f83ec3a3a4ebe0d4735bc7d0dd62fa3d5c1b4412c79ba89 WHIRLPOOL d4aff986a427f7cf4bf812dd77ac80fd61d700967f6f84f341751bbabf44eaf656ffd3950e0e419db3c33afd5ff87c5ff6fddd0fc60df61ce0d454b267a46970
MISC metadata.xml 2404 SHA256 5f1078b6c20d702857df5c10bf06090287ea6778018c9a41a3e5c32609d320ae SHA512 2fb42a0145c765e26bae2b44c0e43641e7f6948a0b6e238827eb44e612521dfc5defaa2a0d5c9cd70f76512280fa9849ba71241f22b164be9858d7db0aff9007 WHIRLPOOL 4af80f8aada5bcbe5e7f0dbe94ec10b81c3b50a4cad87c932772f43bac76722c6d2d10dfd8e5323284b009369296372ef68028b64f3f8e7eb267c60479df6368
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-iQIcBAEBCAAGBQJU82iWAAoJEA/daC2XTKcqtIEP/R2c8ejYHFrm2j+siGuOHaZC
-3YgwdQL5anBniygFbPgfkFETFpkHKm0Hq4IUYl7+sWey/PKbfHXkX3+sz3SWOK3U
-2tidlEx/Tvgi68TbvrZBOvMTw9j3ckCETOTSYT8QIyqL6cz+gvPidR3uA7ISNynq
-/VdEITJV/J0G85+81/AYXV4Gfzy7WEfv7Hm3DaMaIi8H5w11xwEM7aR8nE2t/Pvf
-eLC2RpMxate9x/3AxuZHPJZY7FGCiORaoVl3ZHNT/essUlZv8EnS5wdR0GZHWo9l
-NoaNCnkHqHu+IVten8rjTSPyLBmKJ/T7819i+P8hk6nR4IDICFjDKYkjr3v4OyDG
-fo61JVbjf7/BnecxG+wi8bQbDLf3DCdgxit+7adsY05319SXX6SnklgA3b75TesR
-9XYuv8gnB2v1B4E3VYlQtGx88PELOs0yq+E4Dtz1/9vPIlmVmZHqsPuivcqi+ONA
-1N1EPcmBa7R/QytmlhA4gu4x6XZO7IC5Xa4S0KIQvBaSUtP0tzAU3rrIsvNFw/X5
-lJ9dqKtAH5DAjajRyR5tUgvkpEv4yoFpzcB1++wf1fbKxw5+Jlw2OdhaUzR+FLlU
-YaVbEraF/bxgmZDjMjVKpdWQg6JdJIa+9WRAks/eh7FANWaGmqG63uZN5vFil1Fl
-eGwiBgSCc7RJFcFxkjlH
-=+gsZ
+iQIcBAEBCAAGBQJU82n2AAoJEA/daC2XTKcqGDoQAIV7FDdT4cWubMJcNUL+jxde
+0G/t8jYmvzA+em4JD7d2sfgOcp4tFebnsBCwfXaO4pB2TGa2vjGcxVPpa8fQ2duL
+0zAptXpKeGd4GI6deEHR06L0Pccv7vaS0xeTxcwRv0tGo4ybONTHc/sILR5KZtVa
+fGiWXcesVaKuTkdktSYTQXmSjtAT4FDtfcsiWhDZGE0zTwLpCiGv3x6Eddmi+c6o
+9CVnFwYK5ZHyTNEV3lK3tBur9atHslD8Y5sno3knJSeN2lZPjZSSBTpEnlwEjrLG
+iYgZf63NML66SbKCikvRAEXmuxbCRbfxWlP0ucLmqZiM6DzVzDHNBegyFYcfZeI/
+JbrFsdNFszPHO8e3FEeGQuoGbbyEBMOe9kfIzMm2mXxqNNU5qReUXlNzVK4Kbr18
+sJWBiH6Z/vyGShY1qz5/T99EPUZF5iVhe8K1S71Qe06RRvd84OS9z7omiABqJdJZ
+j6pcDYYt1nJtwYD9+t7zbjIpfz93WAaFgU15Nw7Cm17eqv4jlLfSdtpSPwyd4Hkt
+agR0LlT+DIG71nUZxeSyfPflB7z91Oe93xPBMCOVz46B8HD9NbOe4IHbAUjWljhH
+I2qihDvW5HK5X5YuSHHvcaq4EVTv+GLs2NWy1v+YlBQUysVkaMe1ygbUIjjKAiqk
+b3TNsHxkBivXGNkI8xuv
+=0umS
-----END PGP SIGNATURE-----
diff --git a/media-libs/mesa/files/mesa-10.3.7-format_utils.c.patch b/media-libs/mesa/files/mesa-10.3.7-format_utils.c.patch
new file mode 100644
index 000000000000..e1fba03432f3
--- /dev/null
+++ b/media-libs/mesa/files/mesa-10.3.7-format_utils.c.patch
@@ -0,0 +1,1089 @@
+From cfeb394224f2daeb2139cf4ec489a4dd8297a44d Mon Sep 17 00:00:00 2001
+From: Brian Paul <brianp@vmware.com>
+Date: Fri, 12 Sep 2014 08:31:15 -0600
+Subject: [PATCH] mesa: break up _mesa_swizzle_and_convert() to reduce compile
+ time
+
+This reduces gcc -O3 compile time to 1/4 of what it was on my system.
+Reduces MSVC release build time too.
+
+Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
+---
+ src/mesa/main/format_utils.c | 1030 ++++++++++++++++++++++--------------------
+ 1 file changed, 550 insertions(+), 480 deletions(-)
+
+diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
+index 240e3bc..29d779a 100644
+--- a/src/mesa/main/format_utils.c
++++ b/src/mesa/main/format_utils.c
+@@ -352,9 +352,14 @@ swizzle_convert_try_memcpy(void *dst, GLenum dst_type, int num_dst_channels,
+ */
+ #define SWIZZLE_CONVERT(DST_TYPE, SRC_TYPE, CONV) \
+ do { \
++ const uint8_t swizzle_x = swizzle[0]; \
++ const uint8_t swizzle_y = swizzle[1]; \
++ const uint8_t swizzle_z = swizzle[2]; \
++ const uint8_t swizzle_w = swizzle[3]; \
+ const SRC_TYPE *typed_src = void_src; \
+ DST_TYPE *typed_dst = void_dst; \
+ DST_TYPE tmp[7]; \
++ int s, j; \
+ tmp[4] = 0; \
+ tmp[5] = one; \
+ switch (num_dst_channels) { \
+@@ -423,7 +428,527 @@ swizzle_convert_try_memcpy(void *dst, GLenum dst_type, int num_dst_channels,
+ } \
+ break; \
+ } \
+- } while (0);
++ } while (0)
++
++
++static void
++convert_float(void *void_dst, int num_dst_channels,
++ const void *void_src, GLenum src_type, int num_src_channels,
++ const uint8_t swizzle[4], bool normalized, int count)
++{
++ const float one = 1.0f;
++
++ switch (src_type) {
++ case GL_FLOAT:
++ SWIZZLE_CONVERT(float, float, src);
++ break;
++ case GL_HALF_FLOAT:
++ SWIZZLE_CONVERT(float, uint16_t, _mesa_half_to_float(src));
++ break;
++ case GL_UNSIGNED_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(float, uint8_t, unorm_to_float(src, 8));
++ } else {
++ SWIZZLE_CONVERT(float, uint8_t, src);
++ }
++ break;
++ case GL_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(float, int8_t, snorm_to_float(src, 8));
++ } else {
++ SWIZZLE_CONVERT(float, int8_t, src);
++ }
++ break;
++ case GL_UNSIGNED_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(float, uint16_t, unorm_to_float(src, 16));
++ } else {
++ SWIZZLE_CONVERT(float, uint16_t, src);
++ }
++ break;
++ case GL_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(float, int16_t, snorm_to_float(src, 16));
++ } else {
++ SWIZZLE_CONVERT(float, int16_t, src);
++ }
++ break;
++ case GL_UNSIGNED_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(float, uint32_t, unorm_to_float(src, 32));
++ } else {
++ SWIZZLE_CONVERT(float, uint32_t, src);
++ }
++ break;
++ case GL_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(float, int32_t, snorm_to_float(src, 32));
++ } else {
++ SWIZZLE_CONVERT(float, int32_t, src);
++ }
++ break;
++ default:
++ assert(!"Invalid channel type combination");
++ }
++}
++
++
++static void
++convert_half_float(void *void_dst, int num_dst_channels,
++ const void *void_src, GLenum src_type, int num_src_channels,
++ const uint8_t swizzle[4], bool normalized, int count)
++{
++ const uint16_t one = _mesa_float_to_half(1.0f);
++
++ switch (src_type) {
++ case GL_FLOAT:
++ SWIZZLE_CONVERT(uint16_t, float, _mesa_float_to_half(src));
++ break;
++ case GL_HALF_FLOAT:
++ SWIZZLE_CONVERT(uint16_t, uint16_t, src);
++ break;
++ case GL_UNSIGNED_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_half(src, 8));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, uint8_t, _mesa_float_to_half(src));
++ }
++ break;
++ case GL_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_half(src, 8));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, int8_t, _mesa_float_to_half(src));
++ }
++ break;
++ case GL_UNSIGNED_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, uint16_t, unorm_to_half(src, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_float_to_half(src));
++ }
++ break;
++ case GL_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_half(src, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, int16_t, _mesa_float_to_half(src));
++ }
++ break;
++ case GL_UNSIGNED_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_half(src, 32));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, uint32_t, _mesa_float_to_half(src));
++ }
++ break;
++ case GL_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_half(src, 32));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, int32_t, _mesa_float_to_half(src));
++ }
++ break;
++ default:
++ assert(!"Invalid channel type combination");
++ }
++}
++
++
++static void
++convert_ubyte(void *void_dst, int num_dst_channels,
++ const void *void_src, GLenum src_type, int num_src_channels,
++ const uint8_t swizzle[4], bool normalized, int count)
++{
++ const uint8_t one = normalized ? UINT8_MAX : 1;
++
++ switch (src_type) {
++ case GL_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, float, float_to_unorm(src, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, float, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_HALF_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_unorm(src, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_uint(src));
++ }
++ break;
++ case GL_UNSIGNED_BYTE:
++ SWIZZLE_CONVERT(uint8_t, uint8_t, src);
++ break;
++ case GL_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, int8_t, snorm_to_unorm(src, 8, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, int8_t, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_UNSIGNED_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, uint16_t, unorm_to_unorm(src, 16, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, uint16_t, src);
++ }
++ break;
++ case GL_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, int16_t, snorm_to_unorm(src, 16, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, int16_t, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_UNSIGNED_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, uint32_t, unorm_to_unorm(src, 32, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, uint32_t, src);
++ }
++ break;
++ case GL_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, int32_t, snorm_to_unorm(src, 32, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, int32_t, (src < 0) ? 0 : src);
++ }
++ break;
++ default:
++ assert(!"Invalid channel type combination");
++ }
++}
++
++
++static void
++convert_byte(void *void_dst, int num_dst_channels,
++ const void *void_src, GLenum src_type, int num_src_channels,
++ const uint8_t swizzle[4], bool normalized, int count)
++{
++ const int8_t one = normalized ? INT8_MAX : 1;
++
++ switch (src_type) {
++ case GL_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, float, float_to_snorm(src, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, float, src);
++ }
++ break;
++ case GL_HALF_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_snorm(src, 8));
++ } else {
++ SWIZZLE_CONVERT(uint8_t, uint16_t, _mesa_half_to_float(src));
++ }
++ break;
++ case GL_UNSIGNED_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(int8_t, uint8_t, unorm_to_snorm(src, 8, 8));
++ } else {
++ SWIZZLE_CONVERT(int8_t, uint8_t, src);
++ }
++ break;
++ case GL_BYTE:
++ SWIZZLE_CONVERT(int8_t, int8_t, src);
++ break;
++ case GL_UNSIGNED_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int8_t, uint16_t, unorm_to_snorm(src, 16, 8));
++ } else {
++ SWIZZLE_CONVERT(int8_t, uint16_t, src);
++ }
++ break;
++ case GL_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int8_t, int16_t, snorm_to_snorm(src, 16, 8));
++ } else {
++ SWIZZLE_CONVERT(int8_t, int16_t, src);
++ }
++ break;
++ case GL_UNSIGNED_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int8_t, uint32_t, unorm_to_snorm(src, 32, 8));
++ } else {
++ SWIZZLE_CONVERT(int8_t, uint32_t, src);
++ }
++ break;
++ case GL_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int8_t, int32_t, snorm_to_snorm(src, 32, 8));
++ } else {
++ SWIZZLE_CONVERT(int8_t, int32_t, src);
++ }
++ break;
++ default:
++ assert(!"Invalid channel type combination");
++ }
++}
++
++
++static void
++convert_ushort(void *void_dst, int num_dst_channels,
++ const void *void_src, GLenum src_type, int num_src_channels,
++ const uint8_t swizzle[4], bool normalized, int count)
++{
++ const uint16_t one = normalized ? UINT16_MAX : 1;
++
++ switch (src_type) {
++ case GL_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, float, float_to_unorm(src, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, float, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_HALF_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_unorm(src, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_uint(src));
++ }
++ break;
++ case GL_UNSIGNED_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_unorm(src, 8, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, uint8_t, src);
++ }
++ break;
++ case GL_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_unorm(src, 8, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, int8_t, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_UNSIGNED_SHORT:
++ SWIZZLE_CONVERT(uint16_t, uint16_t, src);
++ break;
++ case GL_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_unorm(src, 16, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, int16_t, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_UNSIGNED_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_unorm(src, 32, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, uint32_t, src);
++ }
++ break;
++ case GL_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_unorm(src, 32, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, int32_t, (src < 0) ? 0 : src);
++ }
++ break;
++ default:
++ assert(!"Invalid channel type combination");
++ }
++}
++
++
++static void
++convert_short(void *void_dst, int num_dst_channels,
++ const void *void_src, GLenum src_type, int num_src_channels,
++ const uint8_t swizzle[4], bool normalized, int count)
++{
++ const int16_t one = normalized ? INT16_MAX : 1;
++
++ switch (src_type) {
++ case GL_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, float, float_to_snorm(src, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, float, src);
++ }
++ break;
++ case GL_HALF_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_snorm(src, 16));
++ } else {
++ SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_half_to_float(src));
++ }
++ break;
++ case GL_UNSIGNED_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(int16_t, uint8_t, unorm_to_snorm(src, 8, 16));
++ } else {
++ SWIZZLE_CONVERT(int16_t, uint8_t, src);
++ }
++ break;
++ case GL_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(int16_t, int8_t, snorm_to_snorm(src, 8, 16));
++ } else {
++ SWIZZLE_CONVERT(int16_t, int8_t, src);
++ }
++ break;
++ case GL_UNSIGNED_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int16_t, uint16_t, unorm_to_snorm(src, 16, 16));
++ } else {
++ SWIZZLE_CONVERT(int16_t, uint16_t, src);
++ }
++ break;
++ case GL_SHORT:
++ SWIZZLE_CONVERT(int16_t, int16_t, src);
++ break;
++ case GL_UNSIGNED_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int16_t, uint32_t, unorm_to_snorm(src, 32, 16));
++ } else {
++ SWIZZLE_CONVERT(int16_t, uint32_t, src);
++ }
++ break;
++ case GL_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int16_t, int32_t, snorm_to_snorm(src, 32, 16));
++ } else {
++ SWIZZLE_CONVERT(int16_t, int32_t, src);
++ }
++ break;
++ default:
++ assert(!"Invalid channel type combination");
++ }
++}
++
++static void
++convert_uint(void *void_dst, int num_dst_channels,
++ const void *void_src, GLenum src_type, int num_src_channels,
++ const uint8_t swizzle[4], bool normalized, int count)
++{
++ const uint32_t one = normalized ? UINT32_MAX : 1;
++
++ switch (src_type) {
++ case GL_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, float, float_to_unorm(src, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, float, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_HALF_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_unorm(src, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_uint(src));
++ }
++ break;
++ case GL_UNSIGNED_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, uint8_t, unorm_to_unorm(src, 8, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, uint8_t, src);
++ }
++ break;
++ case GL_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, int8_t, snorm_to_unorm(src, 8, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, int8_t, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_UNSIGNED_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, uint16_t, unorm_to_unorm(src, 16, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, uint16_t, src);
++ }
++ break;
++ case GL_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, int16_t, snorm_to_unorm(src, 16, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, int16_t, (src < 0) ? 0 : src);
++ }
++ break;
++ case GL_UNSIGNED_INT:
++ SWIZZLE_CONVERT(uint32_t, uint32_t, src);
++ break;
++ case GL_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, int32_t, snorm_to_unorm(src, 32, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, int32_t, (src < 0) ? 0 : src);
++ }
++ break;
++ default:
++ assert(!"Invalid channel type combination");
++ }
++}
++
++
++static void
++convert_int(void *void_dst, int num_dst_channels,
++ const void *void_src, GLenum src_type, int num_src_channels,
++ const uint8_t swizzle[4], bool normalized, int count)
++{
++ const int32_t one = normalized ? INT32_MAX : 12;
++
++ switch (src_type) {
++ case GL_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, float, float_to_snorm(src, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, float, src);
++ }
++ break;
++ case GL_HALF_FLOAT:
++ if (normalized) {
++ SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_snorm(src, 32));
++ } else {
++ SWIZZLE_CONVERT(uint32_t, uint16_t, _mesa_half_to_float(src));
++ }
++ break;
++ case GL_UNSIGNED_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(int32_t, uint8_t, unorm_to_snorm(src, 8, 32));
++ } else {
++ SWIZZLE_CONVERT(int32_t, uint8_t, src);
++ }
++ break;
++ case GL_BYTE:
++ if (normalized) {
++ SWIZZLE_CONVERT(int32_t, int8_t, snorm_to_snorm(src, 8, 32));
++ } else {
++ SWIZZLE_CONVERT(int32_t, int8_t, src);
++ }
++ break;
++ case GL_UNSIGNED_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int32_t, uint16_t, unorm_to_snorm(src, 16, 32));
++ } else {
++ SWIZZLE_CONVERT(int32_t, uint16_t, src);
++ }
++ break;
++ case GL_SHORT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int32_t, int16_t, snorm_to_snorm(src, 16, 32));
++ } else {
++ SWIZZLE_CONVERT(int32_t, int16_t, src);
++ }
++ break;
++ case GL_UNSIGNED_INT:
++ if (normalized) {
++ SWIZZLE_CONVERT(int32_t, uint32_t, unorm_to_snorm(src, 32, 32));
++ } else {
++ SWIZZLE_CONVERT(int32_t, uint32_t, src);
++ }
++ break;
++ case GL_INT:
++ SWIZZLE_CONVERT(int32_t, int32_t, src);
++ break;
++ default:
++ assert(!"Invalid channel type combination");
++ }
++}
++
+
+ /**
+ * Convert between array-based color formats.
+@@ -478,499 +1003,44 @@ _mesa_swizzle_and_convert(void *void_dst, GLenum dst_type, int num_dst_channels,
+ const void *void_src, GLenum src_type, int num_src_channels,
+ const uint8_t swizzle[4], bool normalized, int count)
+ {
+- int s, j;
+- register uint8_t swizzle_x, swizzle_y, swizzle_z, swizzle_w;
+-
+ if (swizzle_convert_try_memcpy(void_dst, dst_type, num_dst_channels,
+ void_src, src_type, num_src_channels,
+ swizzle, normalized, count))
+ return;
+
+- swizzle_x = swizzle[0];
+- swizzle_y = swizzle[1];
+- swizzle_z = swizzle[2];
+- swizzle_w = swizzle[3];
+-
+ switch (dst_type) {
+ case GL_FLOAT:
+- {
+- const float one = 1.0f;
+- switch (src_type) {
+- case GL_FLOAT:
+- SWIZZLE_CONVERT(float, float, src)
+- break;
+- case GL_HALF_FLOAT:
+- SWIZZLE_CONVERT(float, uint16_t, _mesa_half_to_float(src))
+- break;
+- case GL_UNSIGNED_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(float, uint8_t, unorm_to_float(src, 8))
+- } else {
+- SWIZZLE_CONVERT(float, uint8_t, src)
+- }
+- break;
+- case GL_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(float, int8_t, snorm_to_float(src, 8))
+- } else {
+- SWIZZLE_CONVERT(float, int8_t, src)
+- }
+- break;
+- case GL_UNSIGNED_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(float, uint16_t, unorm_to_float(src, 16))
+- } else {
+- SWIZZLE_CONVERT(float, uint16_t, src)
+- }
+- break;
+- case GL_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(float, int16_t, snorm_to_float(src, 16))
+- } else {
+- SWIZZLE_CONVERT(float, int16_t, src)
+- }
+- break;
+- case GL_UNSIGNED_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(float, uint32_t, unorm_to_float(src, 32))
+- } else {
+- SWIZZLE_CONVERT(float, uint32_t, src)
+- }
+- break;
+- case GL_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(float, int32_t, snorm_to_float(src, 32))
+- } else {
+- SWIZZLE_CONVERT(float, int32_t, src)
+- }
+- break;
+- default:
+- assert(!"Invalid channel type combination");
+- }
+- }
+- break;
++ convert_float(void_dst, num_dst_channels, void_src, src_type,
++ num_src_channels, swizzle, normalized, count);
++ break;
+ case GL_HALF_FLOAT:
+- {
+- const uint16_t one = _mesa_float_to_half(1.0f);
+- switch (src_type) {
+- case GL_FLOAT:
+- SWIZZLE_CONVERT(uint16_t, float, _mesa_float_to_half(src))
+- break;
+- case GL_HALF_FLOAT:
+- SWIZZLE_CONVERT(uint16_t, uint16_t, src)
+- break;
+- case GL_UNSIGNED_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_half(src, 8))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, uint8_t, _mesa_float_to_half(src))
+- }
+- break;
+- case GL_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_half(src, 8))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, int8_t, _mesa_float_to_half(src))
+- }
+- break;
+- case GL_UNSIGNED_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, uint16_t, unorm_to_half(src, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_float_to_half(src))
+- }
+- break;
+- case GL_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_half(src, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, int16_t, _mesa_float_to_half(src))
+- }
+- break;
+- case GL_UNSIGNED_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_half(src, 32))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, uint32_t, _mesa_float_to_half(src))
+- }
+- break;
+- case GL_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_half(src, 32))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, int32_t, _mesa_float_to_half(src))
+- }
+- break;
+- default:
+- assert(!"Invalid channel type combination");
+- }
+- }
+- break;
++ convert_half_float(void_dst, num_dst_channels, void_src, src_type,
++ num_src_channels, swizzle, normalized, count);
++ break;
+ case GL_UNSIGNED_BYTE:
+- {
+- const uint8_t one = normalized ? UINT8_MAX : 1;
+- switch (src_type) {
+- case GL_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, float, float_to_unorm(src, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, float, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_HALF_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_unorm(src, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_uint(src))
+- }
+- break;
+- case GL_UNSIGNED_BYTE:
+- SWIZZLE_CONVERT(uint8_t, uint8_t, src)
+- break;
+- case GL_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, int8_t, snorm_to_unorm(src, 8, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, int8_t, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_UNSIGNED_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, uint16_t, unorm_to_unorm(src, 16, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, uint16_t, src)
+- }
+- break;
+- case GL_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, int16_t, snorm_to_unorm(src, 16, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, int16_t, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_UNSIGNED_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, uint32_t, unorm_to_unorm(src, 32, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, uint32_t, src)
+- }
+- break;
+- case GL_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, int32_t, snorm_to_unorm(src, 32, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, int32_t, (src < 0) ? 0 : src)
+- }
+- break;
+- default:
+- assert(!"Invalid channel type combination");
+- }
+- }
+- break;
++ convert_ubyte(void_dst, num_dst_channels, void_src, src_type,
++ num_src_channels, swizzle, normalized, count);
++ break;
+ case GL_BYTE:
+- {
+- const int8_t one = normalized ? INT8_MAX : 1;
+- switch (src_type) {
+- case GL_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, float, float_to_snorm(src, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, float, src)
+- }
+- break;
+- case GL_HALF_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_snorm(src, 8))
+- } else {
+- SWIZZLE_CONVERT(uint8_t, uint16_t, _mesa_half_to_float(src))
+- }
+- break;
+- case GL_UNSIGNED_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(int8_t, uint8_t, unorm_to_snorm(src, 8, 8))
+- } else {
+- SWIZZLE_CONVERT(int8_t, uint8_t, src)
+- }
+- break;
+- case GL_BYTE:
+- SWIZZLE_CONVERT(int8_t, int8_t, src)
+- break;
+- case GL_UNSIGNED_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int8_t, uint16_t, unorm_to_snorm(src, 16, 8))
+- } else {
+- SWIZZLE_CONVERT(int8_t, uint16_t, src)
+- }
+- break;
+- case GL_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int8_t, int16_t, snorm_to_snorm(src, 16, 8))
+- } else {
+- SWIZZLE_CONVERT(int8_t, int16_t, src)
+- }
+- break;
+- case GL_UNSIGNED_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int8_t, uint32_t, unorm_to_snorm(src, 32, 8))
+- } else {
+- SWIZZLE_CONVERT(int8_t, uint32_t, src)
+- }
+- break;
+- case GL_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int8_t, int32_t, snorm_to_snorm(src, 32, 8))
+- } else {
+- SWIZZLE_CONVERT(int8_t, int32_t, src)
+- }
+- break;
+- default:
+- assert(!"Invalid channel type combination");
+- }
+- }
+- break;
++ convert_byte(void_dst, num_dst_channels, void_src, src_type,
++ num_src_channels, swizzle, normalized, count);
++ break;
+ case GL_UNSIGNED_SHORT:
+- {
+- const uint16_t one = normalized ? UINT16_MAX : 1;
+- switch (src_type) {
+- case GL_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, float, float_to_unorm(src, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, float, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_HALF_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_unorm(src, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_uint(src))
+- }
+- break;
+- case GL_UNSIGNED_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_unorm(src, 8, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, uint8_t, src)
+- }
+- break;
+- case GL_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_unorm(src, 8, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, int8_t, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_UNSIGNED_SHORT:
+- SWIZZLE_CONVERT(uint16_t, uint16_t, src)
+- break;
+- case GL_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_unorm(src, 16, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, int16_t, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_UNSIGNED_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_unorm(src, 32, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, uint32_t, src)
+- }
+- break;
+- case GL_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_unorm(src, 32, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, int32_t, (src < 0) ? 0 : src)
+- }
+- break;
+- default:
+- assert(!"Invalid channel type combination");
+- }
+- }
+- break;
++ convert_ushort(void_dst, num_dst_channels, void_src, src_type,
++ num_src_channels, swizzle, normalized, count);
++ break;
+ case GL_SHORT:
+- {
+- const int16_t one = normalized ? INT16_MAX : 1;
+- switch (src_type) {
+- case GL_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, float, float_to_snorm(src, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, float, src)
+- }
+- break;
+- case GL_HALF_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_snorm(src, 16))
+- } else {
+- SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_half_to_float(src))
+- }
+- break;
+- case GL_UNSIGNED_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(int16_t, uint8_t, unorm_to_snorm(src, 8, 16))
+- } else {
+- SWIZZLE_CONVERT(int16_t, uint8_t, src)
+- }
+- break;
+- case GL_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(int16_t, int8_t, snorm_to_snorm(src, 8, 16))
+- } else {
+- SWIZZLE_CONVERT(int16_t, int8_t, src)
+- }
+- break;
+- case GL_UNSIGNED_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int16_t, uint16_t, unorm_to_snorm(src, 16, 16))
+- } else {
+- SWIZZLE_CONVERT(int16_t, uint16_t, src)
+- }
+- break;
+- case GL_SHORT:
+- SWIZZLE_CONVERT(int16_t, int16_t, src)
+- break;
+- case GL_UNSIGNED_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int16_t, uint32_t, unorm_to_snorm(src, 32, 16))
+- } else {
+- SWIZZLE_CONVERT(int16_t, uint32_t, src)
+- }
+- break;
+- case GL_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int16_t, int32_t, snorm_to_snorm(src, 32, 16))
+- } else {
+- SWIZZLE_CONVERT(int16_t, int32_t, src)
+- }
+- break;
+- default:
+- assert(!"Invalid channel type combination");
+- }
+- }
+- break;
++ convert_short(void_dst, num_dst_channels, void_src, src_type,
++ num_src_channels, swizzle, normalized, count);
++ break;
+ case GL_UNSIGNED_INT:
+- {
+- const uint32_t one = normalized ? UINT32_MAX : 1;
+- switch (src_type) { case GL_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, float, float_to_unorm(src, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, float, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_HALF_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_unorm(src, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_uint(src))
+- }
+- break;
+- case GL_UNSIGNED_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, uint8_t, unorm_to_unorm(src, 8, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, uint8_t, src)
+- }
+- break;
+- case GL_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, int8_t, snorm_to_unorm(src, 8, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, int8_t, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_UNSIGNED_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, uint16_t, unorm_to_unorm(src, 16, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, uint16_t, src)
+- }
+- break;
+- case GL_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, int16_t, snorm_to_unorm(src, 16, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, int16_t, (src < 0) ? 0 : src)
+- }
+- break;
+- case GL_UNSIGNED_INT:
+- SWIZZLE_CONVERT(uint32_t, uint32_t, src)
+- break;
+- case GL_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, int32_t, snorm_to_unorm(src, 32, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, int32_t, (src < 0) ? 0 : src)
+- }
+- break;
+- default:
+- assert(!"Invalid channel type combination");
+- }
+- }
+- break;
++ convert_uint(void_dst, num_dst_channels, void_src, src_type,
++ num_src_channels, swizzle, normalized, count);
++ break;
+ case GL_INT:
+- {
+- const int32_t one = normalized ? INT32_MAX : 1;
+- switch (src_type) {
+- case GL_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, float, float_to_snorm(src, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, float, src)
+- }
+- break;
+- case GL_HALF_FLOAT:
+- if (normalized) {
+- SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_snorm(src, 32))
+- } else {
+- SWIZZLE_CONVERT(uint32_t, uint16_t, _mesa_half_to_float(src))
+- }
+- break;
+- case GL_UNSIGNED_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(int32_t, uint8_t, unorm_to_snorm(src, 8, 32))
+- } else {
+- SWIZZLE_CONVERT(int32_t, uint8_t, src)
+- }
+- break;
+- case GL_BYTE:
+- if (normalized) {
+- SWIZZLE_CONVERT(int32_t, int8_t, snorm_to_snorm(src, 8, 32))
+- } else {
+- SWIZZLE_CONVERT(int32_t, int8_t, src)
+- }
+- break;
+- case GL_UNSIGNED_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int32_t, uint16_t, unorm_to_snorm(src, 16, 32))
+- } else {
+- SWIZZLE_CONVERT(int32_t, uint16_t, src)
+- }
+- break;
+- case GL_SHORT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int32_t, int16_t, snorm_to_snorm(src, 16, 32))
+- } else {
+- SWIZZLE_CONVERT(int32_t, int16_t, src)
+- }
+- break;
+- case GL_UNSIGNED_INT:
+- if (normalized) {
+- SWIZZLE_CONVERT(int32_t, uint32_t, unorm_to_snorm(src, 32, 32))
+- } else {
+- SWIZZLE_CONVERT(int32_t, uint32_t, src)
+- }
+- break;
+- case GL_INT:
+- SWIZZLE_CONVERT(int32_t, int32_t, src)
+- break;
+- default:
+- assert(!"Invalid channel type combination");
+- }
+- }
+- break;
++ convert_int(void_dst, num_dst_channels, void_src, src_type,
++ num_src_channels, swizzle, normalized, count);
++ break;
+ default:
+ assert(!"Invalid channel type");
+ }
+--
+2.0.5
+
diff --git a/media-libs/mesa/mesa-10.3.7-r1.ebuild b/media-libs/mesa/mesa-10.3.7-r1.ebuild
index bb34d51c77a0..da53c72c357f 100644
--- a/media-libs/mesa/mesa-10.3.7-r1.ebuild
+++ b/media-libs/mesa/mesa-10.3.7-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-10.3.7-r1.ebuild,v 1.9 2015/02/28 22:23:01 mattst88 Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-10.3.7-r1.ebuild,v 1.10 2015/03/01 19:35:16 mattst88 Exp $
EAPI=5
@@ -208,6 +208,7 @@ src_prepare() {
fi
epatch "${FILESDIR}"/${PN}-10.3.7-dont-use-clrsb.patch
+ epatch "${FILESDIR}"/${PN}-10.3.7-format_utils.c.patch
# relax the requirement that r300 must have llvm, bug 380303
epatch "${FILESDIR}"/${PN}-10.2-dont-require-llvm-for-r300.patch
diff --git a/media-libs/mesa/mesa-10.3.7-r2.ebuild b/media-libs/mesa/mesa-10.3.7-r2.ebuild
index 839e16b9c1e6..a64c6026ab51 100644
--- a/media-libs/mesa/mesa-10.3.7-r2.ebuild
+++ b/media-libs/mesa/mesa-10.3.7-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-10.3.7-r2.ebuild,v 1.2 2015/02/28 22:23:01 mattst88 Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-10.3.7-r2.ebuild,v 1.3 2015/03/01 19:35:16 mattst88 Exp $
EAPI=5
@@ -208,6 +208,7 @@ src_prepare() {
fi
epatch "${FILESDIR}"/${PN}-10.3.7-dont-use-clrsb.patch
+ epatch "${FILESDIR}"/${PN}-10.3.7-format_utils.c.patch
# relax the requirement that r300 must have llvm, bug 380303
epatch "${FILESDIR}"/${PN}-10.2-dont-require-llvm-for-r300.patch