diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp index 5796def9db..c754bc2179 100644 --- a/src/video_core/host_shaders/astc_decoder.comp +++ b/src/video_core/host_shaders/astc_decoder.comp @@ -245,6 +245,10 @@ uint StreamBits(uint num_bits) { return ret; } +void SkipBits(uint num_bits) { + total_bitsread += num_bits; +} + uint StreamColorBits(uint num_bits) { const uint ret = ExtractBits(color_endpoint_data, color_bitsread, num_bits); color_bitsread += num_bits; @@ -748,14 +752,16 @@ void FillError(ivec3 coord) { } void FillVoidExtentLDR(ivec3 coord) { - const uint r_u = ExtractBits(local_buff, 11 + 52 + 16 * 0, 16); - const uint g_u = ExtractBits(local_buff, 11 + 52 + 16 * 1, 16); - const uint b_u = ExtractBits(local_buff, 11 + 52 + 16 * 2, 16); - const uint a_u = ExtractBits(local_buff, 11 + 52 + 16 * 3, 16); + // TODO: If you do extract bits, remember that it may be 11, or OTHER + SkipBits(52); + const uint r_u = StreamBits(16); + const uint g_u = StreamBits(16); + const uint b_u = StreamBits(16); + const uint a_u = StreamBits(16); + const float a = float(a_u) / 65535.0f; const float r = float(r_u) / 65535.0f; const float g = float(g_u) / 65535.0f; const float b = float(b_u) / 65535.0f; - const float a = float(a_u) / 65535.0f; for (uint j = 0; j < block_dims.y; j++) { for (uint i = 0; i < block_dims.x; i++) { imageStore(dest_image, coord + ivec3(i, j, 0), vec4(r, g, b, a)); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 4e85ece38e..c8cb483d17 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1560,7 +1560,7 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu runtime->ViewFormats(info.format))), aspect_mask(ImageAspectMask(info.format)) { if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { - ASSERT(info.size.depth == 1 && "image is deeply absurd"); + ASSERT(info.size.depth == 1 && "ASTC Image depth >1 isn't supported"); flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; flags |= VideoCommon::ImageFlagBits::Converted; flags |= VideoCommon::ImageFlagBits::CostlyLoad; @@ -2435,14 +2435,14 @@ void TextureCacheRuntime::AccelerateImageUpload( std::span swizzles, u32 z_start, u32 z_count) { - if (IsPixelFormatASTC(image.info.format)) { + if (IsPixelFormatASTC(image.info.format) + && image.info.type == ImageType::e2D) { return astc_decoder_pass->Assemble(image, map, swizzles); } - if (bl3d_unswizzle_pass && - IsPixelFormatBCn(image.info.format) && - image.info.type == ImageType::e3D && - image.info.resources.levels == 1 && - image.info.resources.layers == 1) { + if (IsPixelFormatBCn(image.info.format) + && image.info.type == ImageType::e3D + && image.info.resources.levels == 1 + && image.info.resources.layers == 1) { return bl3d_unswizzle_pass->Unswizzle(image, map, swizzles, z_start, z_count); } ASSERT(false);