Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix for DXT5 decompression transparency problem #1425

Merged
merged 8 commits into from Feb 19, 2013

Conversation

Projects
None yet
4 participants
Contributor

nfurtwangler commented Feb 19, 2013

This fixes issue #1418 of mono/MonoGame

Member

mgbot commented Feb 19, 2013

Can one of the admins verify this patch?

@mattzink mattzink and 1 other commented on an outdated diff Feb 19, 2013

MonoGame.Framework/Graphics/DxtUtil.cs
@@ -338,11 +338,14 @@ private static void DecompressDxt5Block(BinaryReader imageReader, int x, int y,
{
byte alpha0 = imageReader.ReadByte();
byte alpha1 = imageReader.ReadByte();
-
- ulong alphaMask = imageReader.ReadUInt32 ();
- alphaMask <<= 16;
- alphaMask += imageReader.ReadUInt16 ();
-
+
+ ulong alphaMask = 0;
+
+ for (int i = 0; i < 6; i++)
@mattzink

mattzink Feb 19, 2013

Contributor

It would be preferable to unroll this loop, as it is small and constant, for performance sake

@nfurtwangler

nfurtwangler Feb 19, 2013

Contributor

Sure thing, I'll update it to be unrolled in an hour or so in case their is any other feedback.

Owner

tomspilman commented Feb 19, 2013

@mgbot test

Member

mgbot commented Feb 19, 2013

Build results will soon be (or already are) available at: http://build.monogame.net/job/BuildPR/10/

Owner

tomspilman commented Feb 19, 2013

@nfurtwangler

You submitted this against the develop3d branch which we are phasing out. I will merge it, but be aware that it won't appear in the new develop branch for a while.

@tomspilman tomspilman added a commit that referenced this pull request Feb 19, 2013

@tomspilman tomspilman Merge pull request #1425 from FourBrosStudio/develop3d
Fix for DXT5 decompression transparency problem
d931135

@tomspilman tomspilman merged commit d931135 into MonoGame:develop3d Feb 19, 2013

1 check passed

default Merged build finished.
Details
Contributor

nfurtwangler commented Feb 19, 2013

Oh thanks, we'll switch over to using the develop branch going forward then.

@tomspilman tomspilman referenced this pull request Feb 21, 2013

Closed

3.0.1 Hotfix Release #1431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment