video_driver_supports_viewport_read should only check if

taking screenshots with the GPU backbuffer is supported,
move outside settings check to callee
This commit is contained in:
twinaphex 2019-06-06 15:06:27 +02:00
parent 43d27006ce
commit 280cec702b
3 changed files with 5 additions and 6 deletions

View File

@ -1534,10 +1534,7 @@ bool video_driver_supports_recording(void)
bool video_driver_supports_viewport_read(void)
{
settings_t *settings = config_get_ptr();
return (settings->bools.video_gpu_screenshot ||
(video_driver_is_hw_context() && !current_video->read_frame_raw))
&& current_video->read_viewport && current_video->viewport_info;
return current_video->read_viewport && current_video->viewport_info;
}
bool video_driver_supports_read_frame_raw(void)

View File

@ -417,7 +417,7 @@ static bool load_content_from_compressed_archive(
if (!string_is_empty(content_ctx->directory_cache))
strlcpy(new_basedir, content_ctx->directory_cache, new_basedir_size);
if (string_is_empty(new_basedir) || !path_is_directory(new_basedir))
if (!path_is_directory(new_basedir))
{
RARCH_WARN("Tried extracting to cache directory, but "
"cache directory was not set or found. "

View File

@ -498,6 +498,7 @@ bool take_screenshot(
bool silence, bool has_valid_framebuffer,
bool fullpath, bool use_thread)
{
settings_t *settings = config_get_ptr();
bool is_paused = false;
bool is_idle = false;
bool is_slowmotion = false;
@ -515,7 +516,8 @@ bool take_screenshot(
screenshot_dir,
name_base, silence, is_paused, is_idle,
has_valid_framebuffer, fullpath, use_thread,
video_driver_supports_viewport_read(),
video_driver_supports_viewport_read()
&& settings->bools.video_gpu_screenshot,
video_driver_supports_read_frame_raw(),
video_driver_get_pixel_format()
);