From 31b125ef578dd5df4e289d1057154dd34f73cb19 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Sat, 19 Jun 2021 00:55:13 -0400 Subject: astc: Various robustness enhancements for the gpu decoder These changes should help in reducing crashes/drivers panics that may occur due to synchronization issues between the shader completion and later access of the decoded texture. --- src/video_core/textures/astc.cpp | 2 ++ src/video_core/textures/astc.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core/textures') diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp index 9b2177ebd..b6e2022f2 100644 --- a/src/video_core/textures/astc.cpp +++ b/src/video_core/textures/astc.cpp @@ -551,6 +551,8 @@ static void FillError(std::span outBuf, u32 blockWidth, u32 blockHeight) { } } } + +static constexpr auto REPLICATE_BYTE_TO_16_TABLE = MakeReplicateTable(); static constexpr u32 ReplicateByteTo16(std::size_t value) { return REPLICATE_BYTE_TO_16_TABLE[value]; } diff --git a/src/video_core/textures/astc.h b/src/video_core/textures/astc.h index c1c37dfe7..441e8eb04 100644 --- a/src/video_core/textures/astc.h +++ b/src/video_core/textures/astc.h @@ -116,7 +116,6 @@ constexpr auto MakeReplicateTable() { return table; } -constexpr auto REPLICATE_BYTE_TO_16_TABLE = MakeReplicateTable(); constexpr auto REPLICATE_6_BIT_TO_8_TABLE = MakeReplicateTable(); constexpr auto REPLICATE_7_BIT_TO_8_TABLE = MakeReplicateTable(); constexpr auto REPLICATE_8_BIT_TO_8_TABLE = MakeReplicateTable(); @@ -126,7 +125,6 @@ struct AstcBufferData { decltype(REPLICATE_6_BIT_TO_8_TABLE) replicate_6_to_8 = REPLICATE_6_BIT_TO_8_TABLE; decltype(REPLICATE_7_BIT_TO_8_TABLE) replicate_7_to_8 = REPLICATE_7_BIT_TO_8_TABLE; decltype(REPLICATE_8_BIT_TO_8_TABLE) replicate_8_to_8 = REPLICATE_8_BIT_TO_8_TABLE; - decltype(REPLICATE_BYTE_TO_16_TABLE) replicate_byte_to_16 = REPLICATE_BYTE_TO_16_TABLE; } constexpr ASTC_BUFFER_DATA; void Decompress(std::span data, uint32_t width, uint32_t height, uint32_t depth, -- cgit v1.2.3