vk: Prebuild base interpreter variants
This commit is contained in:
@@ -1237,6 +1237,16 @@ void VKGSRender::on_init_thread()
|
|||||||
GSRender::on_init_thread();
|
GSRender::on_init_thread();
|
||||||
zcull_ctrl.reset(static_cast<::rsx::reports::ZCULL_control*>(this));
|
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)
|
if (!m_overlay_manager)
|
||||||
{
|
{
|
||||||
m_frame->hide();
|
m_frame->hide();
|
||||||
|
|||||||
@@ -4,11 +4,13 @@
|
|||||||
#include "VKCommonPipelineLayout.h"
|
#include "VKCommonPipelineLayout.h"
|
||||||
#include "VKVertexProgram.h"
|
#include "VKVertexProgram.h"
|
||||||
#include "VKFragmentProgram.h"
|
#include "VKFragmentProgram.h"
|
||||||
|
#include "VKHelpers.h"
|
||||||
|
#include "VKRenderPass.h"
|
||||||
|
|
||||||
|
#include "../Overlays/Shaders/shader_loading_dialog.h"
|
||||||
#include "../Program/GLSLCommon.h"
|
#include "../Program/GLSLCommon.h"
|
||||||
#include "../Program/ShaderInterpreter.h"
|
#include "../Program/ShaderInterpreter.h"
|
||||||
#include "../rsx_methods.h"
|
#include "../rsx_methods.h"
|
||||||
#include "VKHelpers.h"
|
|
||||||
#include "VKRenderPass.h"
|
|
||||||
|
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
@@ -574,4 +576,26 @@ namespace vk
|
|||||||
auto it = m_pipeline_info_cache.insert_or_assign(compiler_opt, result);
|
auto it = m_pipeline_info_cache.insert_or_assign(compiler_opt, result);
|
||||||
return &it.first->second;
|
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 VKVertexProgram;
|
||||||
class VKFragmentProgram;
|
class VKFragmentProgram;
|
||||||
|
|
||||||
|
namespace rsx
|
||||||
|
{
|
||||||
|
struct shader_loading_dialog;
|
||||||
|
}
|
||||||
|
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
using ::program_hash_util::fragment_program_utils;
|
using ::program_hash_util::fragment_program_utils;
|
||||||
@@ -70,6 +75,8 @@ namespace vk
|
|||||||
void init(const vk::render_device& dev);
|
void init(const vk::render_device& dev);
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
|
void preload(rsx::shader_loading_dialog* dlg);
|
||||||
|
|
||||||
glsl::program* get(
|
glsl::program* get(
|
||||||
const vk::pipeline_props& properties,
|
const vk::pipeline_props& properties,
|
||||||
const program_hash_util::fragment_program_utils::fragment_program_metadata& fp_metadata,
|
const program_hash_util::fragment_program_utils::fragment_program_metadata& fp_metadata,
|
||||||
|
|||||||
Reference in New Issue
Block a user