summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-26 01:55:40 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:36 +0200
commitbd24fa97138ff1e33a7f8d3c30a4f4482a6482a8 (patch)
tree5ae0c1d535a258dbe45d7aecccf925f6d1ab62f5 /src/shader_recompiler
parentglsl: Simply FP storage atomics (diff)
downloadyuzu-bd24fa97138ff1e33a7f8d3c30a4f4482a6482a8.tar
yuzu-bd24fa97138ff1e33a7f8d3c30a4f4482a6482a8.tar.gz
yuzu-bd24fa97138ff1e33a7f8d3c30a4f4482a6482a8.tar.bz2
yuzu-bd24fa97138ff1e33a7f8d3c30a4f4482a6482a8.tar.lz
yuzu-bd24fa97138ff1e33a7f8d3c30a4f4482a6482a8.tar.xz
yuzu-bd24fa97138ff1e33a7f8d3c30a4f4482a6482a8.tar.zst
yuzu-bd24fa97138ff1e33a7f8d3c30a4f4482a6482a8.zip
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.cpp9
-rw-r--r--src/shader_recompiler/profile.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index 9c3fd44ba..6f769fa10 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -5,6 +5,7 @@
#include "shader_recompiler/backend/bindings.h"
#include "shader_recompiler/backend/glsl/emit_context.h"
#include "shader_recompiler/frontend/ir/program.h"
+#include "shader_recompiler/profile.h"
namespace Shader::Backend::GLSL {
@@ -40,8 +41,12 @@ void EmitContext::SetupExtensions(std::string& header) {
header += "#extension NV_shader_atomic_fp16_vector : enable\n";
}
if (info.uses_fp16) {
- // TODO: AMD
- header += "#extension GL_NV_gpu_shader5 : enable\n";
+ if (profile.support_gl_nv_gpu_shader_5) {
+ header += "#extension GL_NV_gpu_shader5 : enable\n";
+ }
+ if (profile.support_gl_amd_gpu_shader_half_float) {
+ header += "#extension GL_AMD_gpu_shader_half_float : enable\n";
+ }
}
}
diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h
index 3109fb69c..5d269368a 100644
--- a/src/shader_recompiler/profile.h
+++ b/src/shader_recompiler/profile.h
@@ -83,6 +83,8 @@ struct Profile {
bool support_demote_to_helper_invocation{};
bool support_int64_atomics{};
bool support_derivative_control{};
+ bool support_gl_nv_gpu_shader_5{};
+ bool support_gl_amd_gpu_shader_half_float{};
bool warp_size_potentially_larger_than_guest{};