diff --git a/src/video_core/guest_driver.cpp b/src/video_core/guest_driver.cpp index b1ac254ff9..55b9bd0211 100644 --- a/src/video_core/guest_driver.cpp +++ b/src/video_core/guest_driver.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + #include "video_core/guest_driver.h" namespace VideoCore { @@ -28,7 +30,7 @@ void GuestDriverProfile::DeduceTextureHandlerSize(std::vector&& bound_offse return; } texture_handler_size_deduced = true; - texture_handler_size = sizeof(u32) * min_val; + texture_handler_size = min_texture_handler_size * min_val; } } // namespace VideoCore diff --git a/src/video_core/guest_driver.h b/src/video_core/guest_driver.h index f64f043afa..7687a04346 100644 --- a/src/video_core/guest_driver.h +++ b/src/video_core/guest_driver.h @@ -27,6 +27,8 @@ public: void DeduceTextureHandlerSize(std::vector&& bound_offsets); private: + // Minimum size of texture handler any driver can use. + static constexpr u32 min_texture_handler_size = 4; // This goes with Vulkan and OpenGL standards but Nvidia GPUs can easily // use 4 bytes instead. Thus, certain drivers may squish the size. static constexpr u32 default_texture_handler_size = 8;