diff options
| author | 2021-06-19 00:55:13 -0400 | |
|---|---|---|
| committer | 2021-06-19 09:00:33 -0400 | |
| commit | 31b125ef578dd5df4e289d1057154dd34f73cb19 (patch) | |
| tree | c44e0bfe5d201587da1de1351692617f24769b98 /src/video_core/renderer_opengl | |
| parent | Merge pull request #6484 from CaptV0rt3x/discord-rpc (diff) | |
| download | yuzu-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/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/util_shaders.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/util_shaders.cpp b/src/video_core/renderer_opengl/util_shaders.cpp index 47fddcb6e..d57998cdc 100644 --- a/src/video_core/renderer_opengl/util_shaders.cpp +++ b/src/video_core/renderer_opengl/util_shaders.cpp | |||
| @@ -83,7 +83,6 @@ void UtilShaders::ASTCDecode(Image& image, const ImageBufferMap& map, | |||
| 83 | static constexpr GLuint BINDING_6_TO_8_BUFFER = 3; | 83 | static constexpr GLuint BINDING_6_TO_8_BUFFER = 3; |
| 84 | static constexpr GLuint BINDING_7_TO_8_BUFFER = 4; | 84 | static constexpr GLuint BINDING_7_TO_8_BUFFER = 4; |
| 85 | static constexpr GLuint BINDING_8_TO_8_BUFFER = 5; | 85 | static constexpr GLuint BINDING_8_TO_8_BUFFER = 5; |
| 86 | static constexpr GLuint BINDING_BYTE_TO_16_BUFFER = 6; | ||
| 87 | 86 | ||
| 88 | static constexpr GLuint BINDING_OUTPUT_IMAGE = 0; | 87 | static constexpr GLuint BINDING_OUTPUT_IMAGE = 0; |
| 89 | 88 | ||
| @@ -105,9 +104,6 @@ void UtilShaders::ASTCDecode(Image& image, const ImageBufferMap& map, | |||
| 105 | glBindBufferRange(GL_SHADER_STORAGE_BUFFER, BINDING_8_TO_8_BUFFER, astc_buffer.handle, | 104 | glBindBufferRange(GL_SHADER_STORAGE_BUFFER, BINDING_8_TO_8_BUFFER, astc_buffer.handle, |
| 106 | offsetof(AstcBufferData, replicate_8_to_8), | 105 | offsetof(AstcBufferData, replicate_8_to_8), |
| 107 | sizeof(AstcBufferData::replicate_8_to_8)); | 106 | sizeof(AstcBufferData::replicate_8_to_8)); |
| 108 | glBindBufferRange(GL_SHADER_STORAGE_BUFFER, BINDING_BYTE_TO_16_BUFFER, astc_buffer.handle, | ||
| 109 | offsetof(AstcBufferData, replicate_byte_to_16), | ||
| 110 | sizeof(AstcBufferData::replicate_byte_to_16)); | ||
| 111 | 107 | ||
| 112 | glFlushMappedNamedBufferRange(map.buffer, map.offset, image.guest_size_bytes); | 108 | glFlushMappedNamedBufferRange(map.buffer, map.offset, image.guest_size_bytes); |
| 113 | glUniform2ui(1, tile_size.width, tile_size.height); | 109 | glUniform2ui(1, tile_size.width, tile_size.height); |
| @@ -137,6 +133,7 @@ void UtilShaders::ASTCDecode(Image& image, const ImageBufferMap& map, | |||
| 137 | 133 | ||
| 138 | glDispatchCompute(num_dispatches_x, num_dispatches_y, image.info.resources.layers); | 134 | glDispatchCompute(num_dispatches_x, num_dispatches_y, image.info.resources.layers); |
| 139 | } | 135 | } |
| 136 | glMemoryBarrier(GL_ALL_BARRIER_BITS); | ||
| 140 | program_manager.RestoreGuestCompute(); | 137 | program_manager.RestoreGuestCompute(); |
| 141 | } | 138 | } |
| 142 | 139 | ||