Fixup texture swizzling to actually function

Before this we were not applying the supplied swizzles, will be
superseeded in the future by using guest swizzle values.
This commit is contained in:
Billy Laws 2022-01-21 22:38:21 +00:00 committed by PixelyIon
parent 6e48460c0d
commit be007c4ccc
3 changed files with 7 additions and 7 deletions

View File

@ -74,10 +74,10 @@ namespace skyline::gpu::format {
FORMAT(B10G11R11Float, 32, eB10G11R11UfloatPack32);
FORMAT_NORM_INT_SRGB(R8G8B8A8, 32, eR8G8B8A8);
FORMAT_NORM_INT_SRGB(G8B8A8R8, 32, eB8G8R8A8, .swizzle = {
.blue = swc::Green,
.green = swc::Blue,
.red = swc::Alpha,
.alpha = swc::Red
.blue = swc::Alpha,
.green = swc::Red,
.red = swc::Green,
.alpha = swc::Blue
});
FORMAT_NORM_INT_SRGB(B8G8R8A8, 32, eB8G8R8A8);
FORMAT_SUFF_NORM_INT(A2B10G10R10, 32, eA2B10G10R10, Pack32);

View File

@ -73,7 +73,7 @@ namespace skyline::gpu {
SwizzleChannel blue{SwizzleChannel::Blue}; //!< Swizzle for the blue channel
SwizzleChannel alpha{SwizzleChannel::Alpha}; //!< Swizzle for the alpha channel
constexpr operator vk::ComponentMapping() {
constexpr operator vk::ComponentMapping() const {
auto swizzleConvert{[](SwizzleChannel channel) {
switch (channel) {
case SwizzleChannel::Zero:

View File

@ -51,7 +51,7 @@ namespace skyline::gpu {
.aspectMask = guestTexture.format->vkAspect,
.levelCount = texture->mipLevels,
.layerCount = texture->layerCount,
}, guestTexture.format);
}, guestTexture.format, guestTexture.format->swizzle);
}
} /* else if (mappingMatch) {
// We've gotten a partial match with a certain subset of contiguous mappings matching, we need to check if this is a meaningful overlap
@ -82,6 +82,6 @@ namespace skyline::gpu {
.aspectMask = guestTexture.format->vkAspect,
.levelCount = texture->mipLevels,
.layerCount = texture->layerCount,
}, guestTexture.format);
}, guestTexture.format, guestTexture.format->swizzle);
}
}