summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-16 08:03:08 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:38 +0200
commitcbbca26d182991abf68d9b2e1b1e5935bf4eb476 (patch)
tree09662bca5ff6bfa688e409294562ed1cdd8754b2 /src/video_core/renderer_vulkan
parentshader: Rename maxwell/program.h to translate_program.h (diff)
downloadyuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar
yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.gz
yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.bz2
yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.lz
yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.xz
yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.zst
yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp12
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 0b6fe8e2e..72e6f4207 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -307,6 +307,10 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, Tegra::Engines::Maxw
.has_broken_signed_operations = false,
.ignore_nan_fp_comparisons = false,
};
+ host_info = Shader::HostTranslateInfo{
+ .support_float16 = device.IsFloat16Supported(),
+ .support_int64 = true,
+ };
}
PipelineCache::~PipelineCache() = default;
@@ -484,11 +488,11 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
Shader::Maxwell::Flow::CFG cfg(env, pools.flow_block, cfg_offset, index == 0);
if (!uses_vertex_a || index != 1) {
// Normal path
- programs[index] = TranslateProgram(pools.inst, pools.block, env, cfg);
+ programs[index] = TranslateProgram(pools.inst, pools.block, env, cfg, host_info);
} else {
// VertexB path when VertexA is present.
- Shader::IR::Program& program_va{programs[0]};
- Shader::IR::Program program_vb{TranslateProgram(pools.inst, pools.block, env, cfg)};
+ auto& program_va{programs[0]};
+ auto program_vb{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)};
programs[index] = MergeDualVertexPrograms(program_va, program_vb, env);
}
}
@@ -575,7 +579,7 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
LOG_INFO(Render_Vulkan, "0x{:016x}", key.Hash());
Shader::Maxwell::Flow::CFG cfg{env, pools.flow_block, env.StartAddress()};
- Shader::IR::Program program{TranslateProgram(pools.inst, pools.block, env, cfg)};
+ auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)};
const std::vector<u32> code{EmitSPIRV(profile, program)};
device.SaveShader(code);
vk::ShaderModule spv_module{BuildShader(device, code)};
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
index 167a2ee2e..42da2960b 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
@@ -19,6 +19,7 @@
#include "shader_recompiler/frontend/ir/basic_block.h"
#include "shader_recompiler/frontend/ir/value.h"
#include "shader_recompiler/frontend/maxwell/control_flow.h"
+#include "shader_recompiler/host_translate_info.h"
#include "shader_recompiler/object_pool.h"
#include "shader_recompiler/profile.h"
#include "video_core/engines/maxwell_3d.h"
@@ -157,6 +158,8 @@ private:
ShaderPools main_pools;
Shader::Profile profile;
+ Shader::HostTranslateInfo host_info;
+
std::filesystem::path pipeline_cache_filename;
Common::ThreadWorker workers;