summaryrefslogtreecommitdiff
path: root/src/video_core/textures
diff options
context:
space:
mode:
authorGravatar ameerj2021-06-19 00:55:13 -0400
committerGravatar ameerj2021-06-19 09:00:33 -0400
commit31b125ef578dd5df4e289d1057154dd34f73cb19 (patch)
treec44e0bfe5d201587da1de1351692617f24769b98 /src/video_core/textures
parentMerge pull request #6484 from CaptV0rt3x/discord-rpc (diff)
downloadyuzu-31b125ef578dd5df4e289d1057154dd34f73cb19.tar.gz
yuzu-31b125ef578dd5df4e289d1057154dd34f73cb19.tar.xz
yuzu-31b125ef578dd5df4e289d1057154dd34f73cb19.zip
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.
Diffstat (limited to 'src/video_core/textures')
-rw-r--r--src/video_core/textures/astc.cpp2
-rw-r--r--src/video_core/textures/astc.h2
2 files changed, 2 insertions, 2 deletions
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<u32> outBuf, u32 blockWidth, u32 blockHeight) {
551 } 551 }
552 } 552 }
553} 553}
554
555static constexpr auto REPLICATE_BYTE_TO_16_TABLE = MakeReplicateTable<u32, 8, 16>();
554static constexpr u32 ReplicateByteTo16(std::size_t value) { 556static constexpr u32 ReplicateByteTo16(std::size_t value) {
555 return REPLICATE_BYTE_TO_16_TABLE[value]; 557 return REPLICATE_BYTE_TO_16_TABLE[value];
556} 558}
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() {
116 return table; 116 return table;
117} 117}
118 118
119constexpr auto REPLICATE_BYTE_TO_16_TABLE = MakeReplicateTable<u32, 8, 16>();
120constexpr auto REPLICATE_6_BIT_TO_8_TABLE = MakeReplicateTable<u32, 6, 8>(); 119constexpr auto REPLICATE_6_BIT_TO_8_TABLE = MakeReplicateTable<u32, 6, 8>();
121constexpr auto REPLICATE_7_BIT_TO_8_TABLE = MakeReplicateTable<u32, 7, 8>(); 120constexpr auto REPLICATE_7_BIT_TO_8_TABLE = MakeReplicateTable<u32, 7, 8>();
122constexpr auto REPLICATE_8_BIT_TO_8_TABLE = MakeReplicateTable<u32, 8, 8>(); 121constexpr auto REPLICATE_8_BIT_TO_8_TABLE = MakeReplicateTable<u32, 8, 8>();
@@ -126,7 +125,6 @@ struct AstcBufferData {
126 decltype(REPLICATE_6_BIT_TO_8_TABLE) replicate_6_to_8 = REPLICATE_6_BIT_TO_8_TABLE; 125 decltype(REPLICATE_6_BIT_TO_8_TABLE) replicate_6_to_8 = REPLICATE_6_BIT_TO_8_TABLE;
127 decltype(REPLICATE_7_BIT_TO_8_TABLE) replicate_7_to_8 = REPLICATE_7_BIT_TO_8_TABLE; 126 decltype(REPLICATE_7_BIT_TO_8_TABLE) replicate_7_to_8 = REPLICATE_7_BIT_TO_8_TABLE;
128 decltype(REPLICATE_8_BIT_TO_8_TABLE) replicate_8_to_8 = REPLICATE_8_BIT_TO_8_TABLE; 127 decltype(REPLICATE_8_BIT_TO_8_TABLE) replicate_8_to_8 = REPLICATE_8_BIT_TO_8_TABLE;
129 decltype(REPLICATE_BYTE_TO_16_TABLE) replicate_byte_to_16 = REPLICATE_BYTE_TO_16_TABLE;
130} constexpr ASTC_BUFFER_DATA; 128} constexpr ASTC_BUFFER_DATA;
131 129
132void Decompress(std::span<const uint8_t> data, uint32_t width, uint32_t height, uint32_t depth, 130void Decompress(std::span<const uint8_t> data, uint32_t width, uint32_t height, uint32_t depth,