mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-05-07 13:37:46 +00:00
vk: Prebuild base interpreter variants
This commit is contained in:
parent
90ea92d93b
commit
b3ac8127ea
3 changed files with 43 additions and 2 deletions
|
|
@ -1237,6 +1237,16 @@ void VKGSRender::on_init_thread()
|
|||
GSRender::on_init_thread();
|
||||
zcull_ctrl.reset(static_cast<::rsx::reports::ZCULL_control*>(this));
|
||||
|
||||
if (g_cfg.video.shadermode == shader_mode::async_with_interpreter ||
|
||||
g_cfg.video.shadermode == shader_mode::interpreter_only)
|
||||
{
|
||||
std::unique_ptr<rsx::shader_loading_dialog> dlg = m_overlay_manager
|
||||
? std::make_unique<rsx::shader_loading_dialog_native>(this)
|
||||
: std::make_unique<rsx::shader_loading_dialog>();
|
||||
m_shader_interpreter.preload(dlg.get());
|
||||
dlg->close();
|
||||
}
|
||||
|
||||
if (!m_overlay_manager)
|
||||
{
|
||||
m_frame->hide();
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@
|
|||
#include "VKCommonPipelineLayout.h"
|
||||
#include "VKVertexProgram.h"
|
||||
#include "VKFragmentProgram.h"
|
||||
#include "VKHelpers.h"
|
||||
#include "VKRenderPass.h"
|
||||
|
||||
#include "../Overlays/Shaders/shader_loading_dialog.h"
|
||||
#include "../Program/GLSLCommon.h"
|
||||
#include "../Program/ShaderInterpreter.h"
|
||||
#include "../rsx_methods.h"
|
||||
#include "VKHelpers.h"
|
||||
#include "VKRenderPass.h"
|
||||
|
||||
namespace vk
|
||||
{
|
||||
|
|
@ -574,4 +576,26 @@ namespace vk
|
|||
auto it = m_pipeline_info_cache.insert_or_assign(compiler_opt, result);
|
||||
return &it.first->second;
|
||||
}
|
||||
|
||||
void shader_interpreter::preload(rsx::shader_loading_dialog* dlg)
|
||||
{
|
||||
dlg->create("Precompiling interpreter variants.\nPlease wait...", "Shader Compilation");
|
||||
|
||||
const auto variants = program_common::interpreter::get_interpreter_variants();
|
||||
const u32 limit = ::size32(variants);
|
||||
dlg->set_limit(0, limit);
|
||||
dlg->set_limit(1, 1);
|
||||
|
||||
u32 ctr = 0;
|
||||
for (auto& variant : variants)
|
||||
{
|
||||
build_fs(variant.first | variant.second);
|
||||
build_vs(variant.first | variant.second);
|
||||
dlg->update_msg(0, fmt::format("Building variant %u of %u...", ++ctr, limit));
|
||||
dlg->inc_value(0, 1);
|
||||
}
|
||||
|
||||
dlg->inc_value(1, 1);
|
||||
dlg->refresh();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@
|
|||
class VKVertexProgram;
|
||||
class VKFragmentProgram;
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
struct shader_loading_dialog;
|
||||
}
|
||||
|
||||
namespace vk
|
||||
{
|
||||
using ::program_hash_util::fragment_program_utils;
|
||||
|
|
@ -70,6 +75,8 @@ namespace vk
|
|||
void init(const vk::render_device& dev);
|
||||
void destroy();
|
||||
|
||||
void preload(rsx::shader_loading_dialog* dlg);
|
||||
|
||||
glsl::program* get(
|
||||
const vk::pipeline_props& properties,
|
||||
const program_hash_util::fragment_program_utils::fragment_program_metadata& fp_metadata,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue