diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-02-13 21:50:12 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-03-13 18:16:03 +0100 |
commit | 2985e5e94c82febcf215feb0023f4184b38bb24a (patch) | |
tree | 7b7cd8be3605560707a74a74c281577920a24248 /src/video_core/renderer_opengl/gl_texture_cache.cpp | |
parent | Merge pull request #6053 from Morph1984/time-CalculateSpanBetween (diff) | |
download | yuzu-2985e5e94c82febcf215feb0023f4184b38bb24a.tar yuzu-2985e5e94c82febcf215feb0023f4184b38bb24a.tar.gz yuzu-2985e5e94c82febcf215feb0023f4184b38bb24a.tar.bz2 yuzu-2985e5e94c82febcf215feb0023f4184b38bb24a.tar.lz yuzu-2985e5e94c82febcf215feb0023f4184b38bb24a.tar.xz yuzu-2985e5e94c82febcf215feb0023f4184b38bb24a.tar.zst yuzu-2985e5e94c82febcf215feb0023f4184b38bb24a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index e028677e9..29105ecad 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -307,7 +307,8 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, const VideoCommon::ImageInfo& info) { - // Disable accelerated uploads for now as they don't implement swizzled uploads + return (!runtime.HasNativeASTC() && IsPixelFormatASTC(info.format)); + // Disable other accelerated uploads for now as they don't implement swizzled uploads return false; switch (info.type) { case ImageType::e2D: @@ -567,6 +568,9 @@ void TextureCacheRuntime::BlitFramebuffer(Framebuffer* dst, Framebuffer* src, void TextureCacheRuntime::AccelerateImageUpload(Image& image, const ImageBufferMap& map, std::span<const SwizzleParameters> swizzles) { + if (IsPixelFormatASTC(image.info.format)) { + return util_shaders.ASTCDecode(image, map, swizzles); + } switch (image.info.type) { case ImageType::e2D: return util_shaders.BlockLinearUpload2D(image, map, swizzles); @@ -599,6 +603,10 @@ FormatProperties TextureCacheRuntime::FormatInfo(ImageType type, GLenum internal } } +bool TextureCacheRuntime::HasNativeASTC() const noexcept { + return device.HasASTC(); +} + TextureCacheRuntime::StagingBuffers::StagingBuffers(GLenum storage_flags_, GLenum map_flags_) : storage_flags{storage_flags_}, map_flags{map_flags_} {} |