In the computeUpload path, use a shader intrinsic to unpack the color.

This commit is contained in:
Henrik Rydgård 2017-12-11 16:02:13 +01:00 committed by Unknown W. Brackets
parent 101019d5cd
commit e9b2af7fc7

View file

@ -141,11 +141,7 @@ void main() {
// Unpack the color (we could look it up in a CLUT here if we wanted...) // Unpack the color (we could look it up in a CLUT here if we wanted...)
// It's a bit silly that we need to unpack to float and then have imageStore repack, // It's a bit silly that we need to unpack to float and then have imageStore repack,
// but the alternative is to store to a buffer, and then launch a vkCmdCopyBufferToImage instead. // but the alternative is to store to a buffer, and then launch a vkCmdCopyBufferToImage instead.
vec4 outColor = vec4( vec4 outColor = unpackUnorm4x8(color);
(color & 0xFF) * (1.0 / 255.0),
((color >> 8) & 0xFF) * (1.0 / 255.0),
((color >> 16) & 0xFF) * (1.0 / 255.0),
((color >> 24) & 0xFF) * (1.0 / 255.0));
imageStore(img, ivec2(x,y), outColor); imageStore(img, ivec2(x,y), outColor);
} }
)"; )";
@ -730,8 +726,8 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
// Compute experiment // Compute experiment
if (actualFmt == VULKAN_8888_FORMAT) { if (actualFmt == VULKAN_8888_FORMAT) {
// Enable the experiment you want. // Enable the experiment you want.
computeCopy = true; // computeCopy = true;
// computeUpload = true; computeUpload = true;
} }
if (computeUpload) { if (computeUpload) {