summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
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_opengl
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_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp12
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index c05cd5d28..b459397f5 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -201,6 +201,10 @@ ShaderCache::ShaderCache(RasterizerOpenGL& rasterizer_, Core::Frontend::EmuWindo
.has_gl_component_indexing_bug = device.HasComponentIndexingBug(),
.has_gl_precise_bug = device.HasPreciseBug(),
.ignore_nan_fp_comparisons = true,
+ },
+ host_info{
+ .support_float16 = false,
+ .support_int64 = true,
} {
if (use_asynchronous_shaders) {
workers = CreateWorkers();
@@ -373,15 +377,15 @@ std::unique_ptr<GraphicsPipeline> ShaderCache::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);
for (const auto& desc : programs[index].info.storage_buffers_descriptors) {
total_storage_buffers += desc.count;
}
} 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)};
for (const auto& desc : program_vb.info.storage_buffers_descriptors) {
total_storage_buffers += desc.count;
}
@@ -449,7 +453,7 @@ std::unique_ptr<ComputePipeline> ShaderCache::CreateComputePipeline(
LOG_INFO(Render_OpenGL, "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)};
u32 num_storage_buffers{};
for (const auto& desc : program.info.storage_buffers_descriptors) {
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h
index d24b54d90..6952a1f2c 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.h
+++ b/src/video_core/renderer_opengl/gl_shader_cache.h
@@ -14,6 +14,7 @@
#include "common/common_types.h"
#include "common/thread_worker.h"
#include "shader_recompiler/frontend/ir/value.h"
+#include "shader_recompiler/host_translate_info.h"
#include "shader_recompiler/object_pool.h"
#include "video_core/engines/shader_type.h"
#include "video_core/renderer_opengl/gl_compute_pipeline.h"
@@ -82,6 +83,8 @@ private:
std::unordered_map<ComputePipelineKey, std::unique_ptr<ComputePipeline>> compute_cache;
Shader::Profile profile;
+ Shader::HostTranslateInfo host_info;
+
std::filesystem::path shader_cache_filename;
std::unique_ptr<ShaderWorker> workers;
};